Created
February 12, 2019 17:56
-
-
Save manifestinteractive/3ec8f91ca0a6dd993f4be94560642967 to your computer and use it in GitHub Desktop.
Quick Backup Script
This file contains hidden or 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
#!/bin/bash | |
# Backup Important Files on Storage Drive | |
echo -e "\n\033[48;5;22m Starting Storage Backup › Android \033[0m\n" | |
rsync -hrPul /Volumes/Storage/Android /Volumes/Backup/Storage | |
echo -e "\n\033[38;5;34m✓ BACKUP SYNCED\033[0m\n" | |
echo -e "\n\033[48;5;22m Starting Storage Backup › Music \033[0m\n" | |
rsync -hrPul /Volumes/Storage/Music /Volumes/Backup/Storage | |
echo -e "\n\033[38;5;34m✓ BACKUP SYNCED\033[0m\n" | |
echo -e "\n\033[48;5;22m Starting Storage Backup › Plex \033[0m\n" | |
rsync -hrPul /Volumes/Storage/Plex /Volumes/Backup/Storage | |
echo -e "\n\033[38;5;34m✓ BACKUP SYNCED\033[0m\n" | |
echo -e "\n\033[48;5;22m Starting Storage Backup › Projects \033[0m\n" | |
rsync -hrPul /Volumes/Storage/Projects /Volumes/Backup/Storage | |
echo -e "\n\033[38;5;34m✓ BACKUP SYNCED\033[0m\n" | |
# Backup Important Files on Primary Drive | |
echo -e "\n\033[48;5;22m Starting HD Backup › Backup \033[0m\n" | |
rsync -hrPul /Backup /Volumes/Backup/HD | |
echo -e "\n\033[38;5;34m✓ BACKUP SYNCED\033[0m\n" | |
echo -e "\n\033[48;5;22m Starting HD Backup › Home Folder \033[0m\n" | |
rsync -hrPul --exclude='.*' --exclude='AndroidStudioProjects' --exclude='Creative Cloud Files' --exclude='Library' --exclude='Public' --exclude='zsh-syntax-highlighting' --exclude="Pictures/Photos Library.photoslibrary" /Users/peter /Volumes/Backup/HD | |
echo -e "\n\033[38;5;34m✓ BACKUP SYNCED\033[0m\n" | |
# All Done | |
echo -e "\033[38;5;34m✓ COMPLETE\033[0m\n" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Setup
Obviously this file was created for my needs, but is a quick thing that could be duplicated by anyone with an external drive. I personally prefer the use of rsync for my backups, but the script can be modified easily for your own needs.
I stick this in the file in the root of my backup drive with a folder structure that is basically this:
Then, whenever I think about it, I plug in the drive and run the
backup.sh
command. The key here is that I have two drives that I do this with, and it backs up just what I need, and nothing else. So I end up with duplicate backups, and I just knock them out one after another. These backup drives are in addition to my primary external 12TB RAID storage drive.The output from this script ends up looking like this: