Skip to content

Instantly share code, notes, and snippets.

@mfyz
Last active Aug 6, 2021
Embed
What would you like to do?
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