Last active
December 18, 2019 03:19
-
-
Save syntholly/5fa1e721604a9029cd10b9892c73f37c to your computer and use it in GitHub Desktop.
Backup MacOS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Backup MacOS Files
Currently Works With
brew list
brew cask list
crontab
filegem list
pip list
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.