mackup README

The project's README from github.com/lra/mackup. As one markdown file: README.md.

Mackup™

Tests PyPI version Python Versions Ruff mypy License

Backup and keep your application settings in sync.

Table of contents

Quickstart

On macOS or Linux, if you want an easy install, you can install Homebrew and do:

# Install Mackup
brew install mackup

# Launch it and back up your files
mackup backup

If not running macOS or Linux, or you don't like Homebrew, you can use pip.

# Install Mackup with PIP
pip install --upgrade mackup

# Launch it and back up your files
mackup backup

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

Next, on any new workstation, do:

# Install Mackup
brew install mackup

# Launch it and restore your files
mackup restore

Done!

You can find more detailed instructions in INSTALL.md.

Usage

backup, restore, link install, link uninstall and link operate on all of your configured applications by default. To limit a command to a single application, add its name (the identifier shown by mackup list), e.g. mackup backup vim. Naming an application overrides the [applications_to_sync] / [applications_to_ignore] settings in your .mackup.cfg, so you can act on any supported app without editing your config.

mackup backup [application]

Back up your application files. Copy your local config files into the Mackup folder. Name an application to back up only that one, e.g. mackup backup vim.

mackup restore [application]

Restore your application settings on a newly installed workstation. Copy config files from the Mackup folder to your home folder. Name an application to restore only that one, e.g. mackup restore emacs.

mackup link install [application]

Move your local config files into the Mackup folder, and link them to their original place. Name an application to install only that one.

$${\color{red}warning}$$ the link strategy doesn't work correctly on macOS

mackup link [application]

On another workstation, links local config files from the Mackup folder. Name an application to link only that one.

mackup link uninstall [application]

Copy back any synced config file to its original place. Removes the links and copies config files from the Mackup folder back into your home. Name an application (e.g. mackup link uninstall git) to unlink only that one; scoping to an application skips the global uninstall confirmation.

mackup list

Display the list of applications supported by Mackup.

mackup -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 makes setting up the environment easy and simple.

There are 2 modes of operations: copy mode and link mode.

Copy mode

Copy mode is used to back up and restore your files. The files are backed up into the configured Mackup folder, which can be in Dropbox, iCloud, or wherever you configure it.

It is covered by the 2 commands:

[!WARNING] If you are using Mackup on a current version of macOS, link mode will BREAK YOUR PREFERENCES. macOS Sonoma (macOS 14) and later don't support symlinked preferences, see issue #2035 for additional information. PR #2085 added copy mode, which should be used instead.

Link mode is used to move your config files into the Mackup folder, and link them back to their original place.

This mode is useful if you are using multiple workstations, and want to keep your application settings in sync at all times.

Let's take git as an example. Your settings for git are saved in your home folder, in the .gitconfig file.

It is covered by the 3 commands:

If you have Dropbox, these things happen when you launch mackup link install:

  1. cp ~/.gitconfig ~/Dropbox/Mackup/.gitconfig
  2. rm ~/.gitconfig
  3. ln -s ~/Dropbox/Mackup/.gitconfig ~/.gitconfig

Now your git config is always backed up and up to date on all your workstations.

When you launch mackup link, here's what it's really doing:

  1. ln -s ~/Dropbox/Mackup/.gitconfig ~/.gitconfig

That's it, you got your git config setup on your new workstation.

mackup does the same for any supported application.

You can revert all your files to their original state.

# Just run this
mackup link uninstall

This will remove the symlinks and copy back the files from the Mackup folder in Dropbox to their original places in your home. The Mackup folder and the files in it stay put, so that any other computer also running Mackup is unaffected.

To revert a single application instead, name it, e.g. mackup link uninstall git. Scoping the command to an application unlinks only that app — the rest of your setup and the Mackup config itself are left in place, and the global uninstall confirmation is skipped.

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?

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

What's up with the weird name

Mackup is just a portmanteau of Mac and Backup. It is simple, short, and easy to remember, and it corresponds with the whole idea of Mackup: the simpler – the better! (And I suck at naming stuff, but who doesn't.)

Architecture

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

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.

mackup (lra/mackup)

Searching Database…

15.3K ·GitHub
这是什么?Mackup 会备份你的应用设置和配置文件(例如 dotfiles、编辑器和 shell 配置),并通过 Dropbox 或 iCloud 等云存储文件夹,在多台工作电脑之间保持同步。
它是同步守护进程,还是只是一次性备份命令?它是一个需要你手动运行的命令行工具,没有后台守护进程。它有两种模式:复制模式用于一次性备份和还原;链接模式会把配置文件符号链接到同步文件夹中,使其持续保持同步。
我该怎么把它运行起来?在 macOS 或 Linux 上,你可以通过 Homebrew 安装,也可以在任何平台上使用 pip 安装。安装后,在当前电脑上运行 mackup backup,在新工作电脑上运行 mackup restore。
使用它是否需要云存储服务?需要。Mackup 依赖一个可以在多台机器之间同步的文件夹,例如 Dropbox、Google Drive、iCloud,或任何通过 Git 同步的文件夹。
在当前版本的 macOS 上,链接模式安全吗?不安全。在 macOS Sonoma(14)及更高版本上,系统会破坏符号链接形式的偏好设置,因此链接模式会导致你的设置失效;应改用复制模式。
它能在哪些平台上运行?Mackup 可在 macOS 和 Linux 上运行;两者都可以通过 Homebrew 安装,也可以在任何平台上通过 pip 安装。
开箱即用支持多少个应用?数百个,涵盖编辑器、shell、终端、包管理器,以及许多效率和开发工具,完整列表见 README 中较长的“Supported Applications”(支持的应用)部分。
我能只备份一个应用,而不是全部吗?可以。在命令后面加上应用名称即可,例如 mackup backup vim 或 mackup restore emacs,使操作只针对该单个应用。
如果我常用的应用不受支持怎么办?你可以创建 ~/.mackup 目录,用来同步任何自定义应用的配置文件,或任意个人文件,例如 ~/.gitignore,无需等待官方添加支持。
Mackup 为什么会被开发出来?作者厌倦了每次设置新工作电脑时都要丢失或重新配置应用设置,于是没有只写一个个人 shell 脚本,而是开发了一个通用工具,并希望社区能帮忙添加更多应用的支持。
Creator
lra
Size
2.8 MB
Stars
15.3K
Age
13y
Commits · 90 Days