Skip to main content

mackup-ng

Tests PyPI version Python Versions Ruff mypy License

Backup and keep your application settings in sync.

mackup-ng is a maintained fork of mackup by Laurent Raufaste. It replaces the backup/restore/link commands with a single two-way sync plus an rm command, while keeping the same on-disk conventions (.mackup.cfg, the Mackup storage folder).

⚠️ Incompatible with the original mackup. This package installs a mackup command (and a mackup-ng alias) that shadows the upstream mackup — do not install both in the same environment, or the last one installed wins. The on-disk format also diverges: mackup-ng records deletion tombstones (.mackup-deletions) and syncs by modification time, so a folder written by mackup-ng is not meant to be managed by the original mackup.

Table of contents

Quickstart

Install it with pip (or uv):

# Install mackup-ng with pip
pip install --upgrade mackup-ng

# ...or as an isolated tool with uv
uv tool install mackup-ng

# Launch it and sync your files
mackup-ng sync

You're all set and can back up from now on.

Next, on any new workstation, do:

# Install mackup-ng
pip install --upgrade mackup-ng

# Launch it and sync your files
mackup-ng sync

Done!

You can find more detailed instructions in INSTALL.md.

Usage

mackup-ng sync

Synchronize your application files between your home folder and the Mackup folder.

mackup-ng rm <path>

Remove a managed config path locally and from the Mackup folder, and record the deletion so future syncs remove it on other machines too.

mackup-ng info <path>...

Report how a path relates to the backup: the config that manages it, whether it is synced (and why not, when it isn't), both copies with their size and mtime, what the last sync on this machine did to it, and whether the two sides still agree. Exits with status 1 when a path is managed by no config.

$ mackup-ng info ~/.zshrc
Path: .zshrc
Config: zsh (Zsh)
Sync: yes
Local: /home/you/.zshrc — 8.9 KiB, 2026-08-17 13:33
Backup: /home/you/Dropbox/Mackup/.zshrc — 8.5 KiB, 2026-08-14 09:02
Last sync: 2026-08-14 09:02 (Backed up)
State: diverged — local is newer; next sync backs it up

The "Last sync" line comes from a machine-local log that mackup-ng sync writes to $XDG_STATE_HOME/mackup/sync-log.json; it reads never recorded on this machine until the first sync after upgrading.

mackup-ng list

Display the list of applications supported by mackup-ng.

mackup-ng mark <marker> / mackup-ng unmark <marker> / mackup-ng markers

Set / remove / list machine-local markers (e.g. backup, low-resource, no-linger, no-apikey, no-dconf). See "Machine-local extras" below.

mackup-ng dconf-add <path>...

Track and dump dconf path(s), e.g. /org/gnome/terminal/ (Linux/GNOME).

mackup-ng apply

Run every config's action blocks (without syncing files); blocks also run automatically during sync.

mackup-ng -h

Get some help, obviously...

What does it do

By only tracking pure configuration files, it keeps the crap out of your freshly new installed workstation (no cache, temporary and locally specific files are transferred).

mackup-ng makes setting up the environment easy and simple.

mackup-ng uses sync mode.

Sync mode

Sync mode is used to synchronize your files. The files are stored in the configured Mackup folder, which can be in Dropbox, iCloud, or wherever you configure it.

It is covered by the commands:

  • mackup-ng sync
  • mackup-ng rm <path>

sync reconciles every managed file in both directions by modification time. To drop a single managed path everywhere, use mackup-ng rm <path>: it removes the file locally and from the Mackup folder, and records a deletion tombstone so future syncs remove it on your other machines too.

Ignored files

Storage backends drop their own bookkeeping inside the folders they sync. Syncthing is the loud one: each concurrent edit leaves a *.sync-conflict-* copy next to the file. mackup-ng carries none of it in either direction, and deletes none of it either — those files belong to the tool that made them. A fresh conflict copy is skipped when picking the newer side too, so it cannot beat a real edit on another machine.

Patterns live in <name>.toml files with an [ignore] table, read from the package, then ~/.mackup/ignores/, then $XDG_CONFIG_HOME/mackup/ignores/:

# ~/.mackup/ignores/mine.toml
[ignore]
name = "My junk"
patterns = ["*.bak", "*.orig"]

The built-in syncthing.toml covers *.sync-conflict-*, ~syncthing~*.tmp, .syncthing.*.tmp, .stfolder, .stversions and .stignore. A local file of the same name replaces the built-in outright, so this turns the whole set off:

# ~/.mackup/ignores/syncthing.toml
[ignore]
patterns = []

A single application config can add patterns that apply to its own paths only:

# ~/.mackup/applications/notes.toml
name = "notes"
files = [".notes"]
ignore = ["*.bak"]

Update check

At the end of mackup sync, mackup-ng checks whether a newer release is on PyPI and prints one line if there is:

mackup-ng 2.1.0 -> 2.2.0 available. Upgrade: uv tool upgrade mackup-ng

The upgrade command is guessed from where the running executable lives (snap, uv tool, pipx, or plain pip). The result is cached under $XDG_CACHE_HOME/mackup/update-check.json for a day, so at most one request a day leaves the machine, and a dry run (-n) never checks at all. Any failure — offline, timeout, a bad answer — is silent.

The request goes to https://pypi.org/pypi/mackup-ng/json. It carries nothing but the package name, though like any request it discloses the machine's IP address and the fact that mackup-ng is in use. To switch it off for good on a machine:

mackup-ng mark no-update-check

Supported Storages

See the README file in the doc directory for more info.

Unsupported Storages

Supported Applications

Can you support application X

We can with your help ;)

Personalization & configuration

Have an application that shouldn't be generally supported but that you use? Or some personal files you want to sync, e.g. various config files in a ~/.config/ directory or your personal ~/.gitignore?

Fork Additions

This fork adds path templating for application config definitions (*.toml in src/mackup_ng/applications) to reduce duplication and simplify cross-platform entries. App definitions are flat TOML (no [application] wrapper): top-level name and a files array (plus an optional [mapped_files] table and action blocks). A legacy [application] table is still accepted.

1. Brace expansion ({...})

You can define multiple paths in one line:

name = "Code"
files = [
    "${MACKUP_XDG_CONFIG}/Code/User/{snippets,keybindings.json,settings.json}",
]

This expands to one entry per item (cartesian product if multiple brace groups are used).

2. Platform selector ([...])

You can choose different path fragments per platform:

files = [
    "${MACKUP_XDG_CONFIG}/[mac:Blender,blender]",
]

Another example with a full-path fallback:

files = [
    "[linux:${MACKUP_XDG_CONFIG}/myapp/linux.conf,mac:${MACKUP_XDG_CONFIG}/MyApp/mac.conf,windows:${MACKUP_XDG_CONFIG}/MyApp/windows.conf,${MACKUP_XDG_CONFIG}/myapp/other.conf]",
]
  • linux:, mac:, windows: are supported keys
  • the last unkeyed item is the fallback
  • in this fork, the fallback also acts as the canonical backup path

This means the selector can map different local paths to one shared backup path. Example:

files = [
    "[mac:${MACKUP_XDG_CONFIG}/MyApp/config.json,linux:${MACKUP_XDG_CONFIG}/myapp/config.json,${MACKUP_XDG_CONFIG}/shared/myapp-config.json]",
]

Behavior:

  • macOS local path: ${MACKUP_XDG_CONFIG}/MyApp/config.json
  • Linux local path: ${MACKUP_XDG_CONFIG}/myapp/config.json
  • backup path (all platforms): canonical Linux path for the fallback, i.e. .config/shared/myapp-config.json

3. Built-in XDG variables

These reserved Mackup-owned aliases (not OS environment variables) mimic the XDG base directories on every OS, even ones that don't set the XDG_* env vars. The MACKUP_ prefix keeps them distinct from real ${VAR} env references; XDG marks the semantics:

  • ${MACKUP_XDG_CONFIG} -> .config (Linux) / Library/Application Support (macOS) / AppData/Roaming (Windows)
  • ${MACKUP_XDG_DATA} -> .local/share (Linux) / Library/Application Support (macOS) / AppData/Local (Windows)
  • ${MACKUP_XDG_STATE} -> .local/state (Linux) / Library/Application Support (macOS) / AppData/Local (Windows)
  • ${MACKUP_XDG_CACHE} -> .cache (Linux) / Library/Caches (macOS) / AppData/Local (Windows)

Important in this fork:

  • built-in variables in local paths are resolved for the current OS
  • built-in variables in backup paths are always resolved to Linux canonical paths (e.g. ${MACKUP_XDG_CONFIG} in backup becomes .config)

4. Environment variables (${VAR} + source_env)

Any ${VAR} that is not a reserved MACKUP_* built-in is resolved as a real environment variable, falling back to KEY=VALUE lines in the app's source_env files. It expands to the same value on both the local and backup side, so use it for relative, machine-specific fragments (a profile dir name, a hostname). Unresolved or absolute results skip just that entry.

name = "Firefox"
source_env = ["~/.config/mackup-env"]   # KEY=VALUE lines; env takes priority
files = [
    "${MACKUP_XDG_CONFIG}/firefox/${FF_PROFILE}/prefs.js",
]

5. Processing order

Path templates are resolved in this order:

  1. Platform selector [...] (produces local path + canonical backup path)
  2. Built-in variables (${MACKUP_XDG_CONFIG}, ${MACKUP_XDG_DATA}, ${MACKUP_XDG_STATE}, ${MACKUP_XDG_CACHE})
  3. Environment variables (any other ${VAR}, from env / source_env)
  4. Brace expansion {...}

6. Config style in this fork

  • Upstream-style xdg_configuration_files is not used in this fork; express entries directly in files using ${MACKUP_XDG_CONFIG}/...
  • many app definitions in this fork were normalized to use ${MACKUP_XDG_CONFIG}, ${MACKUP_XDG_DATA}, and selectors to avoid macOS/Linux duplicates (for example VS Code-family configs)

7. Explicit local → backup mapping ([mapped_files])

files keeps the local path and storage layout identical. To decouple them, add a [mapped_files] table with LOCAL = BACKUP pairs:

[mapped_files]
".config/app/grisa.profile/user.js" = ".config/app/profile/user.js"

Paths are quoted TOML strings, so spaces, dashes and even -> are safe inside them. Both sides honor selectors, built-in vars and braces (brace groups zip pairwise). Handy when a machine-specific local path (e.g. a per-machine Firefox profile dir) should share one canonical path in the backup folder.

One backup file can feed several local files — repeat the value:

[mapped_files]
".config/app/work.profile/user.js"     = ".config/app/profile/user.js"
".config/app/personal.profile/user.js" = ".config/app/profile/user.js"

All members of such a group are peers: whichever copy you edited last wins and is propagated to the others on the next mackup sync.

Destinations are unique. If a later config maps the same local path to a different backup file, the earlier mapping is dropped — that is how you overwrite a stock config with your own. Configs are read stock first, then $XDG_CONFIG_HOME/mackup/applications, then ~/.mackup/applications, so your own files always win. Run mackup sync -v to see which mappings were overridden and which backup files are left without a destination.

An orphaned backup file (no destination maps to it) is left untouched; it is only reported by mackup sync -v, never deleted on its own. mackup rm <path> removes one destination and tombstones it — the shared backup source survives as long as another destination still feeds from it, and is only deleted once the last destination is removed. Re-declaring a destination with the same backup file is not an override and is not reported.

mackup rm also accepts a path inside a managed directory. Because the members of a group mirror each other, such a removal is applied to the whole group: the file goes from the backup source and from every destination, and the tombstone keeps it from coming back on the next sync.

8. Action blocks

A config file can also carry action blocks — imperative steps run around its file sync (pre/post). A block has an optional [when] conditions sub-table and exactly one action sub-table; there is no type key. Actions: [copy], [chmod], [run], [xml] (edit XML), [systemd] (user drop-in).

name = "SSH"
files = [".ssh"]

# after syncing .ssh, fix its permissions (default phase = post)
[when]
os = ["linux", "macos"]
[chmod]
path = "~/.ssh"
recursive = true
dir_mode = "700"
file_mode = "600"

[when] keys (any-of lists): os, arch, marker, not_marker, command, gui, exists, not_exists, env. For more than one block per file use a [[block]] array with [block.when] / [block.<action>]. Configs run sorted by filename; mackup apply runs blocks without syncing. A block-only file (no files) is a pure hook.

Conditions written at the top level of a config gate the whole config — its synced files as well as its actions. A config whose conditions do not hold on this machine declares nothing, so a mapping from another config keeps the destination. That is how one machine can take a different source for the same local file:

# ~/.mackup/applications/zz-termux-colors-eink.toml
[when]
os = ["android"]
marker = ["eink"]

[mapped_files]
".termux/colors.properties" = ".termux/colors-eink.properties"

Run mackup show <app> to see whether a config's conditions hold here, and mackup sync -v to list the configs skipped for that reason. To gate a single action instead of the config, put the condition inside [[block]] as [block.when].

Top-level keys (files, mapped_files, etc.) must come before the [when] header in the file. TOML assigns a bare key = value line to whichever table opened above it — write files = [...] after [when] and it becomes when.files instead of the config's own file list, so the config silently syncs nothing. Loading a config warns about this: an unrecognized key inside [when] or a [when] that isn't a table at all both print a Warning: line naming the config and the problem.

9. Machine-local extras (~/.mackup/)

Beyond custom app configs, ~/.mackup/ is the home for machine-local behavior:

~/.mackup/
├── applications/   config *.toml files: sync lists AND action blocks
├── markers/        LOCAL marker definitions (*.toml, same format as apps)
└── dconf-backup/   dconf dumps (*.dconf)

Marker state (which markers are on) lives in $XDG_STATE_HOME/mackup/markers/ (default ~/.local/state/mackup/markers/), not under ~/.mackup/; a pre-XDG ~/.mackup/markers/ is migrated automatically.

Marker state is not the only machine-local state: sync also records what it did to each destination in $XDG_STATE_HOME/mackup/sync-log.json, which is what mackup-ng info reports as "Last sync". Both stay out of the synced backup folder, since they describe this machine only.

  • Markers (mark/unmark/markers) are empty flag files gating behavior on one machine only. backup marks the source machine.
  • dconf (Linux/GNOME): the backup-role machine dumps tracked paths before the file sync; other machines load them after. Opt out with the no-dconf marker; register paths with dconf-add.
  • Action blocks (in applications/*.toml, applied during sync / via apply): each config file may carry blocks — a top-level implicit block and/or a [[block]] array. A block = base scalars + a [when] conditions sub-table + exactly one action sub-table whose name is the action ([copy] / [chmod] / [run] / [xml] / [systemd]); no type key. Base scalars: phase (pre/post, relative to that config's file sync) and optional restart_service. [when] holds short-keyed conditions (os, arch, marker, not_marker, command, gui, exists, not_exists, env). In a [[block]] array the sub-tables are [block.when] / [block.<action>]; at the top level [when] / [<action>]. Configs apply sorted by filename — cross-cutting hooks use numeric prefixes (10-, 40-).
  • Environment contract: [run] blocks receive a MACKUP_* environment (MACKUP_ROLE, MACKUP_OS, MACKUP_ARCH, MACKUP_CONFIG_DIR, MACKUP_BACKUP_DIR, MACKUP_MARKERS_DIR, MACKUP_DCONF_BACKUP_DIR, ...). A pre-sync executable is a [run] block with phase = "pre".

Requires Python 3.12+.

Why did you do this

Yesterday, I had a talk with Zach Zaro, complaining about the pain it is to reconfigure our Macbook each time we get a new one or install from scratch. That's a talk we have already had months ago.

I change my workstation every X months. Each time I either lose my apps' configurations, or I just waste a bunch of hours getting setup like I was on my old box. I also spend a lot of time reconfiguring the same stuff again on all my workstations (home, work).

Boring...

Some people tried to solve the problem on the application layer, like Github's Boxen, but it solves a different problem, from my point of view. I don't spend a lot of time installing or downloading stuff. I spend time configuring it.

For years, I've used a personal shell script that was copying known config files into Subversion, Git or Dropbox, and linked them into my home. But I felt a lot of us had the same problem: Making a more generic tool could help others and I could get help from others to support more apps in the tool.

So here comes Mackup, the little tool that will sync all your application configs to Dropbox (or Google Drive, or anything).

And it's GPL, of course.

What platforms are supported

  • macOS
  • GNU/Linux

What's up with the weird name

Mackup is a portmanteau of Mac and Backup. It is simple, short, and easy to remember, and it corresponds with the whole idea: the simpler – the better! The -ng suffix ("next generation") marks this maintained fork, which streamlines Mackup down to a single two-way sync plus rm.

Architecture

Want to understand how Mackup works internally? Check out the Architecture Guide which includes:

  • Visual architecture diagram
  • Component breakdown
  • Data flow diagrams
  • Design decisions
  • Extension points for contributors

Perfect for contributors who want to understand the codebase or users curious about how their configs are managed.

Where can I find more information

In the doc directory.

Metadata

Release files for mackup-ng 2.4.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mackup-ng 2.4.1
File Size Uploaded Provenance Actions
mackup_ng-2.4.1.tar.gz 265.0 kB Without provenance Details for mackup_ng-2.4.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for mackup-ng 2.4.1
File Interpreter ABI Platform Actions
mackup_ng-2.4.1-py3-none-any.whl Python 3 none any Details for mackup_ng-2.4.1-py3-none-any.whl

Total release size: 514.2 kB

Release files / mackup_ng-2.4.1.tar.gz

Download URL mackup_ng-2.4.1.tar.gz
Size 265.0 kB
Tags Source
SHA-256 checksum
How to use checksums
8519bd8023a19d4f4fe8fe36c59c726e181cbcf235fc684a7c4e888e33bfe6c3
BLAKE2b-256 checksum
How to use checksums
cb46d431b861dda573699769fe44ccb0d0a9168f7481299155a8870c045b6b0e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.7 {"installer":{"name":"uv","version":"0.12.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"CachyOS Linux","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / mackup_ng-2.4.1-py3-none-any.whl

Download URL mackup_ng-2.4.1-py3-none-any.whl
Size 249.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
794c0a61b051942df82d5e7cc9dee2cd1b648020b80b95dd9fe30fd9e7ff98c2
BLAKE2b-256 checksum
How to use checksums
cf6d396ff34a48c1b2a33d4a63b0a4c9aad80b518792d2b00792bc63d75e4ebb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.7 {"installer":{"name":"uv","version":"0.12.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"CachyOS Linux","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for mackup-ng 2.4.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page