Skip to content

Instantly share code, notes, and snippets.

@mfyz
Last active August 6, 2021 04:33
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 mfyz/087379eb77ec8581b665e234de238ee1 to your computer and use it in GitHub Desktop.
Save mfyz/087379eb77ec8581b665e234de238ee1 to your computer and use it in GitHub Desktop.
External SSD Backup Script
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
#
# Run command below in terminal:
#
#
# sudo sh /Volumes/ExtremeSSD/Backup/Take-Backups.sh
#
#
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
echo "\n\033[1;33m== Alfred Preferences (Workflows) \033[0m"
sudo tar --exclude='remote/*' -cz ~/Library/Application\ Support/Alfred/Alfred.alfredpreferences/* \
> /Volumes/ExtremeSSD/Backup/FolderSnapshots/AlfredPreferences-$(date +"%Y-%m-%d").tar
echo "\n\033[1;33m== VSCode \033[0m"
sudo tar -cz ~/Library/Application\ Support/Code/User \
> /Volumes/ExtremeSSD/Backup/FolderSnapshots/VSCode-User-$(date +"%Y-%m-%d").tar
echo "\n\033[1;33m== Sublime Text \033[0m"
sudo tar -cz ~/Library/Application\ Support/Sublime\ Text\ 3/Packages/User \
> /Volumes/ExtremeSSD/Backup/FolderSnapshots/SublimeText-User-$(date +"%Y-%m-%d").tar
echo "\n\033[1;33m== Backing up iCloud Drive \033[0m"
sudo tar cf - ~/Library/Mobile\ Documents \
> /Volumes/ExtremeSSD/Backup/FolderSnapshots/iCloudDrive-$(date +"%Y-%m-%d").tar
# echo "\n\033[1;33m== Backing up Dropbox - Todos \033[0m"
# sudo tar cf - /Users/fatih/Dropbox\ \(Personal\)/Todos \
# > /Volumes/ExtremeSSD/Backup/FolderSnapshots/DropboxTodos-$(date +"%Y-%m-%d").tar
echo "\n\033[1;33m== Backing up Google Drive - Personal \033[0m"
sudo tar cf - /Users/fatih/Google\ Drive \
> /Volumes/ExtremeSSD/Backup/FolderSnapshots/GDrivePersonal-$(date +"%Y-%m-%d").tar
echo "\n\033[1;33m== Backing up Home-Fatih Folder (Library, Drive, Development separate) \033[0m"
sudo tar cf - \
--exclude '*/node_modules/*'\
--exclude './Dropbox*'\
--exclude './Google*'\
--exclude 'VirtualBoxes'\
--exclude 'Development'\
--exclude 'Downloads'\
--exclude 'Music'\
--exclude 'Library'\
--exclude 'Movies'\
--exclude 'Pictures'\
--exclude 'Katalon*'\
--exclude 'Documents/FacebookSDK'\
--exclude 'go'\
--exclude '.Trash'\
--exclude '.dropbox'\
--exclude '.docker'\
--exclude '.cocoapods'\
--exclude '.Genymobile'\
--exclude '.gradle'\
--exclude '.android'\
--exclude '.npm'\
--exclude '.nvm'\
--exclude '.node-gyp'\
--exclude '.electron-gyp'\
--exclude '.electron'\
--exclude '.gem'\
--exclude '.cache'\
--exclude '.composer'\
--exclude '.phpls'\
--exclude '.expo'\
--exclude '.Deco'\
--exclude '.fastlane'\
--exclude '.vscode/extensions'\
--exclude '.itmstransporter'\
--exclude '.pencil' \
/Users/fatih > /Volumes/ExtremeSSD/Backup/FolderSnapshots/MacHomeFatih-$(date +"%Y-%m-%d").tar
echo "\n\033[1;33m== Backing up Home-Fatih / Development Folder \033[0m"
sudo tar cf - --exclude 'node_modules'\
--exclude '.git'\
--exclude 'vendor'\
--exclude 'ios/build'\
--exclude 'amber-android/app/build' -P /Users/fatih/Development \
> /Volumes/ExtremeSSD/Backup/FolderSnapshots/MacHomeFatihDevelopment-$(date +"%Y-%m-%d").tar
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment