backupHome.sh (712B)
1 #!/bin/bash 2 3 # (a) Archive mode (recursive, symlinks, preserve permissions, etc.) 4 # (z) Compress 5 6 # This ensures in case there have been any issues with the mount it will remount it. 7 echo "=== STARTING ===" 8 date 9 10 rsync -avz --delete \ 11 --exclude '.cache' \ 12 --exclude '.unison' \ 13 --exclude 'syncing' \ 14 --exclude '.sculptor' \ 15 --exclude '.config/Sculptor' \ 16 --exclude '.dev_sculptor' \ 17 --exclude '.librewolf' \ 18 -e ssh /home/andrew/ andrew@brgr:/backups/deepthought-home 19 20 if [ $? -eq 0 ]; then 21 date 22 echo "=== COMPLETED SUCCESSFULLY ===" 23 notify-send -t 5000 "Backup succeeded" 24 else 25 echo "=== RSYNC FAILED ===" 26 notify-send -u critical -t 5000 "Error! Backup Failed" 27 28 fi