Skip to content

Instantly share code, notes, and snippets.

@vSanjo
Last active December 18, 2019 03:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vSanjo/5fa1e721604a9029cd10b9892c73f37c to your computer and use it in GitHub Desktop.
Save vSanjo/5fa1e721604a9029cd10b9892c73f37c to your computer and use it in GitHub Desktop.
Backup MacOS
# Ideally you could put this in your crontab, maybe for once a day.
cd ~/Desktop && brew list > brew-list.txt && (brew cask list > brew-cask-list.txt & code --list-extensions > code-list-extensions.txt & pip list > pip-list.txt & crontab -l > crontab-l.txt & gem list > gem-list.txt & command ls -lAh /Applications/ > ls-applications.txt & npm -g list > npm-g-list.txt & yarn global list > yarn-global-list.txt) && zip macos-backup-$(date +"%m-%d-%y").zip -9 -v -T -ll -m brew-list.txt brew-cask-list.txt crontab-l.txt gem-list.txt ls-applications.txt npm-g-list.txt yarn-global-list.txt code-list-extensions.txt && cd -1
@vSanjo
Copy link
Author

vSanjo commented Dec 18, 2019

Backup MacOS Files

Currently Works With

  • brew list
  • brew cask list
  • VSCode's Extensions
  • crontab file
  • gem list
  • pip list
  • MacOS Installed Applications
  • npm -g list
  • yarn global list

The script then creates a zip of those files with format macos-backup-[date].zip, then promptly removes the created .txt files and returns you back to your previous folder.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment