Code Monkey home page Code Monkey logo

mackup's Introduction

Mackup

Keep your application settings in sync.

Table of content

Quickstart

If you have Dropbox installed and want to use it to save your config files, that's super easy.

On macOS, 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 you don't like Homebrew, you can use pip.

Note: The below command will check if a previous version of Mackup is already installed on your system. If this is the case, it will be upgraded to the latest version.

# Install Mackup with PIP
pip install --upgrade mackup

# Launch it and back up your files
mackup backup

On Ubuntu, pip will install to the current user's home directory rather than system-wide. Because of this, when installing pip on Ubuntu you will need to run pip install with the --system flag as well (on other platforms this is not needed)

You're all set and constantly backed 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

mackup backup

Backup your application settings.

mackup restore

Restore your application settings on a newly installed workstation.

mackup uninstall

Copy back any synced config file to its original place.

mackup list

Display the list of applications supported by Mackup.

mackup -h

Get some help, obviously...

What does it do

  • Back ups your application settings in a safe directory (e.g. Dropbox)
  • Syncs your application settings among all your workstations
  • Restores your configuration on any fresh install in one command line

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 transfered).

Mackup makes setting up the environment easy and simple, saving time for your family, great ideas, and all the cool stuff you like.

Bullsh*t, what does it really do to my files

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

Backup

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

  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.

Restore

When you launch mackup restore, 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.

Uninstall

You can revert all your files to their original state.

# Just run this
mackup 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.

Supported Storages

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

Unsupported Storages

  • Box: No longer supported as it ignores dotfiles, see #807.

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 a cool file you want to sync?

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 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.)

Where can I find more information

In the doc directory.

mackup's People

Contributors

amatos avatar ameyuuno avatar atipugin avatar damianoamatruda avatar danielsuo avatar demidovakatya avatar dnicolson avatar ediventurin avatar hakubo avatar hiyer avatar icopp avatar iloveitaly avatar joshmedeski avatar kfinlay avatar lorenzofanchi avatar lra avatar morphinewan avatar ninjabong avatar orenshk avatar orschiro avatar paxperscientiam avatar rbartoli avatar revolter avatar sh78 avatar shrwnsan avatar star-szr avatar tcattd avatar timidger avatar vitorgalvao avatar yonkeltron avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mackup's Issues

Add it in homebrew

I'd love to be able to do

brew install mackup

Can't though, it's against the homebrew rules for an author to submit his own app =/

Error related to GnuPG

Just upgraded and ran mackup and got this:

โ†’ mackup backup Backing up .gnupg... Traceback (most recent call last): File "/usr/bin/mackup", line 854, in <module> main() File "/usr/bin/mackup", line 807, in main app.backup() File "/usr/bin/mackup", line 356, in backup copy(filepath, mackup_filepath) File "/usr/bin/mackup", line 591, in copy shutil.copytree(src, dst) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 205, in copytree shutil.Error: [('/Users/steve/.gnupg/S.gpg-agent', '/Users/steve/Dropbox/Mackup/.gnupg/S.gpg-agent', "[Errno 102] Operation not supported on socket: '/Users/steve/.gnupg/S.gpg-agent'")]

Sublime Text 2 optimization(?)

First of all, thanks for this. Looking for a solution like this today while I do a fresh install of Mountain Lion, and here it is =)

RE ST2:

Could possibly just do the following:

'Library/Application Support/Sublime Text 2/Packages/User',

As it'll install any missing packages from the preference if the corresponding system doesn't have it yet. Reference: http://stackoverflow.com/questions/11365948/how-to-save-restore-sublime-text-2-configs-plugins-to-migrate-to-another-compute

Filezilla Support

Im brand new to Mackup, but will be getting far more involed ASAP

Would be great to add support for Filezilla.
The site manager is a one file affair - XML, which is located in:

/Users/username/.filezilla/.8 (3 xml files and one queue file)

If someone can explain how that is done, I can then become way more involved, if you'll have me!!

Thanks

Sync between OS X versions?

This sounds great.
I have to run both Mountain Lion and Snow Leopard. On seperate partitions and/or machines)

Are the settings preference files the same between OS iterations and will Mackup sync between them?

OH - and I guess this is just settings - right? No application support files and whatnot?

Sync Stata preferences and scripts

Please add support for Stata preference syncing:
~/Library/Preferences/com.stata.stata*.plist

And for Stata script syncing:
~/Library/Application Support/Stata/*

Thank you.

ST2 can not be open when running the script

I was working on this project and testing out a new configuration file feature (almost done) and it completely tanked my sublime text setup.

I forgot to close ST2 and it when I ran the script and ST2 blew up with dialoge boxes about missing packages.

My user settings file is gone, not sure why. I am still in triage so I will report back after I understand what happened.

Error backing up SourceTree

Backing up Library/Application Support/SourceTree/sourcetree.license...
Traceback (most recent call last):
  File "./mackup.py", line 731, in <module>
    main()
  File "./mackup.py", line 684, in main
    app.backup()
  File "./mackup.py", line 310, in backup
    delete(filepath)
  File "./mackup.py", line 490, in delete
    os.remove(filepath)
OSError: [Errno 1] Operation not permitted: '/Users/dbingham/Library/Application Support/SourceTree/sourcetree.license'

Add support for Divvy

Hi, Ira!

mackup should add support for Divvy, to remember configurations and the invoke key combo.

Divvy saves its files here:
userdir/Library/Preferences/com.mizage.direct.Divvy.plist
userdir/Library/Preferences/com.mizage.divvy.plist

Problem if link already exists

I'll add as a comment for now, but if you're running ./mackup restore, and there's already a link there that points to nowhere, the restore process blows up.

Restoring Library/Preferences/org.pqrs.KeyRemap4MacBook.plist...
Restoring Library/Application Support/KeyRemap4MacBook/private.xml...
Traceback (most recent call last):
File "./mackup.py", line 925, in
main()
File "./mackup.py", line 886, in main
app.restore()
File "./mackup.py", line 459, in restore
home_filepath))):
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/posixpath.py", line 154, in samefile
s2 = os.stat(f2)
OSError: [Errno 2] No such file or directory: '/Volumes/Users/kdm/Library/Application Support/Adobe/Lightroom/Develop Presets'

In this case, /Volumes/Users/kdm/Library/Application Support/Adobe/Lightroom/Develop Presets was a link pointing to a directory that didn't exist any more. Once I rmed the link, the restore completed successfully.

Do not try to sync opened files

Use lsof or something similar to check that if any file mackup plans to link (and thus move) is opened. If it's the case, stop print a message to the user stating that it can't move the conf files of this application, and move to the next application to sync.

PR welcomed.

Add support for non-Dropbox locations

I'd like to propose a command line argument for the path to backup/restore from. This would allow using a non-Dropbox location, such as a git repository, for storing files.

I'll happily fork to do so, but thought I'd open up the conversation for design input.

Sync quicklook, services, scripts?

Have you given any thought to syncing the quicklook, services, and scripts directories? I can create a fork to do this, but I wanted to see if there were any concerns with doing so before I did.

Crashed while backing up TextMate files

Backing up Library/Application Support/TextMate...
Traceback (most recent call last):
  File "/usr/local/bin/mackup", line 947, in <module>
    main()
  File "/usr/local/bin/mackup", line 900, in main
    app.backup()
  File "/usr/local/bin/mackup", line 449, in backup
    copy(filepath, mackup_filepath)
  File "/usr/local/bin/mackup", line 684, in copy
    shutil.copytree(src, dst)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 205, in copytree
    raise Error, errors
shutil.Error: [('/Users/me/Library/Application Support/TextMate/Managed/Bundles/iPhone.tmbundle/Support/objc_completion2.rb', '/Users/me/Dropbox/Mackup/Library/Application Support/TextMate/Managed/Bundles/iPhone.tmbundle/Support/objc_completion2.rb', "[Errno 2] No such file or directory: '/Users/me/Library/Application Support/TextMate/Managed/Bundles/iPhone.tmbundle/Support/objc_completion2.rb'"), ('/Users/me/Library/Application Support/TextMate/Managed/Bundles/iPhone.tmbundle/Support/SpecialRules.txt', '/Users/me/Dropbox/Mackup/Library/Application Support/TextMate/Managed/Bundles/iPhone.tmbundle/Support/SpecialRules.txt', "[Errno 2] No such file or directory: '/Users/me/Library/Application Support/TextMate/Managed/Bundles/iPhone.tmbundle/Support/SpecialRules.txt'")]

OSError trying to run backup

I could not run backup after fresh 'install'
All i got was:

Traceback (most recent call last):
File "./mackup", line 828, in
main()
File "./mackup", line 776, in main
mackup.check_for_usable_backup_env()
File "./mackup", line 456, in check_for_usable_backup_env
self._check_for_usable_environment()
File "./mackup", line 447, in _check_for_usable_environment
if is_process_running('Sublime Text'):
File "./mackup", line 756, in is_process_running
stdout=DEVNULL)
File "/usr/local/Cellar/python/2.7.4/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 524, in call
return Popen(_popenargs, *_kwargs).wait()
File "/usr/local/Cellar/python/2.7.4/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 711, in init
errread, errwrite)
File "/usr/local/Cellar/python/2.7.4/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 1308, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory

after removing:

is_process_running('Sublime Text'):
...

It run smoothly
and now I can happily use it!

Problem after uninstall

After uninstalling the app, using sudo ./mackup uninstall, everytime I restart my machine I loose all the configuration from the previous backup up apps. I have to re-register and reconfigure all of them.

Sync Scenario preferences and scripts

Please add support for Scenario preference syncing:
~/Library/Preferences/com.lagente.scenario.plist

And for Scenario script syncing:
~/Library/Scenario/*

Thank you.

Sync Skim preferences

Please add support for Skim preference syncing:
~/Library/Preferences/net.sourceforge.skim-app.skim.plist

Thank you.

Allow selective backup

First of all, thanks for this great little utility.

As there are more and more supported applications, it would be awesome if backup can be selective according to the specific needs.

For example, I would like to keep my .ssh/ local but currently there seems no way to exclude it from being backed up.

Uninstall should un-Mackup

As a user, I'd like the ability to un-Mackup the files that Mackup has symlinked to my Dropbox and uninstall, so that I can dis-continue using Mackup (or feel good about being able to, if desired)

Scenario: Uninstalling is simple, but the process to un-Mackup is manual. It would be neat to have it so that uninstall was a method that moved all settings and dotfiles back in there place, and dropped the script or prompted the user with a command to enter to rm the script from where-ever they have it installed.

support for /usr/bin

Is it possible to add support for /usr/bin somehow?
I am not expert on this area but it would be great to have my command line apps ready to run everywhere.

What I am doing at the moment is appending ~/Dropbox/Mackup/bin: to PATH variable and being able to sync everything from there. Not sure if that is the best way to go though.

Cheers

'Yes' to all option on restore

A good idea (IMO) would be to have a Yes to all option for the 'Overwrite blah blah' on mackup restore. Currently you have to type 'Yes' (full word, no abbreviations) to each conflict, a 'Yes to All' option would save some time an enhance user experience. It's probably a good idea though that if it is implemented, it gives you a list of all the conflicts at once before you can 'Yes to All' without knowing what 'All' is (if you get my drift.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.