├── readme.md ├── system-backup-list.sh └── system-list-backup.alfredworkflow /readme.md: -------------------------------------------------------------------------------- 1 | # Backup a list of things on your computer to Dropbox 2 | 3 | Just a simple way to backup a list of apps, fonts and packages you have installed on your Mac -> Dropbox. Run manually or schedule. Simple and for everyone. 4 | 5 | ## The script will backup this to your Dropbox 6 | 7 | + Mac Apps (A list of the installed apps) 8 | + Homebrew (A list of the installed packages) 9 | + NPM (A list of the globally installed packages) 10 | + Fonts (A list of the installed fonts) 11 | + Bash profile (The current bash profile) 12 | + Aliases 13 | + SSH config 14 | + Hosts (The hosts file) 15 | + Apache (macOS built in) 16 | + Gitconfig 17 | + VSCode (Lists of the current Settings, Keybindings and Extensions) 18 | + Crontab (A list of the crontab) 19 | + Sequel Pro (A lit of the Favorites) 20 | 21 | Note: 22 | 23 | + Quit Sequel Pro if it’s running. 24 | + Replace ~/Library/Application Support/Sequel Pro/Data/+ Favourites.plist with your backed up copy. 25 | + Replace ~/Library/Preferences/com.sequelpro.SequelPro.plist with + your backed up copy. 26 | + Fire up Sequel Pro and you should be back in business. 27 | 28 | ## Notes 29 | 30 | Of course, change all this to your taste/needs. 31 | I'm using the full paths to some of the binaries here. You can also just use ``brew`` or ``npm``, but that might not work correctly when you use it in Automator or with Alfred. 32 | 33 | Cron 34 | 35 | ## Run backup every day at 09.00 36 | 37 | 1. Open up crontab ``env EDITOR=nano crontab -e`` 38 | 2. Schedule the bash script. Ex. Run 09.00 am monday-friday 39 | 40 | ```bash 41 | 0 09 * * 1-5 /mypath/system-list-backup.sh 42 | ``` 43 | 44 | Automator 45 | 46 | ## Run backup every time you login to your computer 47 | 48 | 1. Start Automator.app 49 | 2. Select "Application" 50 | 3. Click "Show library" 51 | 4. Add "Run Shell script" 52 | 5. Copy & paste the scripts above 53 | 6. Test it 54 | 7. Save it somewhere, ex to your ``Applications`` folder 55 | 8. Add this app to System Preferences -> Account -> Login items 56 | 9. Done! 57 | 58 | Alfred 59 | 60 | ## [Alfred Workflow](https://www.alfredapp.com/workflows/) 61 | 62 | Use the ``system-list-backup.alfredworkflow`` file in this repo. 63 | 64 | ![alfred-1](https://cloud.githubusercontent.com/assets/307676/14941464/1137a8c0-0f9d-11e6-85f2-26759ad1b53e.jpg) 65 | 66 | ![alfred-2](https://cloud.githubusercontent.com/assets/307676/14941465/114fe782-0f9d-11e6-935d-caf54cfb16a3.jpg) 67 | 68 | Start typing the keyword "backup" + enter 69 | -------------------------------------------------------------------------------- /system-backup-list.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | clear 4 | 5 | USERNAME=$USER; 6 | DROPBOX_FOLDER="/Users/${USERNAME}/Dropbox/backup/system-backup-list" 7 | 8 | # Apps 9 | cd /Applications && ls > ${DROPBOX_FOLDER}/apps.txt 10 | 11 | # Homebrew 12 | /usr/local/bin/brew list > ${DROPBOX_FOLDER}/brew.txt 13 | 14 | # NPM 15 | cd /usr/local/lib/node_modules && ls > ${DROPBOX_FOLDER}/npm.txt 16 | 17 | # Fonts 18 | cd /Library/Fonts/ && ls > ${DROPBOX_FOLDER}/fonts.txt 19 | cd /Users/${USERNAME}/Library/Fonts && ls > ${DROPBOX_FOLDER}/fonts-user.txt 20 | 21 | # Bash profile 22 | cat ~/.bash_profile > ${DROPBOX_FOLDER}/bash_profile.txt 23 | 24 | # Aliases 25 | cat ~/.aliases > ${DROPBOX_FOLDER}/aliases.txt 26 | 27 | # SSH 28 | cp ~/.ssh/config ${DROPBOX_FOLDER}/ssh_config.txt 29 | 30 | # Hosts 31 | cp /etc/hosts ${DROPBOX_FOLDER}/hosts.txt 32 | 33 | # Apache 34 | cp /etc/apache2/extra/httpd-vhosts.conf ${DROPBOX_FOLDER}/vhosts.conf.txt 35 | 36 | # Gitconfig 37 | cp ~/.gitconfig ${DROPBOX_FOLDER}/gitconfig.txt 38 | 39 | # VSCode 40 | cat /Users/${USERNAME}/Library/Application*Support/Code/User/settings.json > ${DROPBOX_FOLDER}/vscode_settings.json 41 | cat /Users/${USERNAME}/Library/Application*Support/Code/User/keybindings.json > ${DROPBOX_FOLDER}/vscode_keybindings.json 42 | cd ~/.vscode/extensions && ls > ${DROPBOX_FOLDER}/vscode_extensions.json 43 | 44 | # Crontab 45 | crontab -l > ${DROPBOX_FOLDER}/cronjobs.txt 46 | 47 | # Sequel Pro 48 | cp /Users/$USERNAME/Library/Application\ Support/Sequel\ Pro/Data/Favorites.plist ${DROPBOX_FOLDER}/sequel-pro-favorites.txt 49 | cp /Users/${USERNAME}/Library/Preferences/com.sequelpro.SequelPro.plist ${DROPBOX_FOLDER}/sequel-pro-plist.txt 50 | 51 | echo "$(tput setaf 2)✔ Backup finished!$(tput sgr0)" 52 | -------------------------------------------------------------------------------- /system-list-backup.alfredworkflow: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urre/system-backup-list/6c82ecb7b31dc178286a1d553219405b97f470a3/system-list-backup.alfredworkflow --------------------------------------------------------------------------------