Rsync Script

This is MY copy of Rsync, the commands ADDS new and updated files, DELETES old files.

create this in a folder, named 'rsync.sh'

#!/bin/bash
 
# Backup script for External HDD
 
# Misc Backup
rsync -r -t -p -o -v --progress --delete --ignore-existing -s /media/library/misc /media/backup/backup
 
# Movies Backup
rsync -r -t -p -o -v --progress --delete --ignore-existing -s /media/library/movies  /media/backup/backup
 
# Music Backup
rsync -r -t -p -o -v --progress --delete --ignore-existing -s /media/library/music /media/backup/backup
 
# TV Recordings
rsync -r -t -p -o -v --progress --delete --ignore-existing -s /media/library/recordings /media/backup/backup
 
# TV Boxsets
rsync -r -t -p -o -v --progress --delete --ignore-existing -s /media/library/tv /media/backup/backup

Make the file executable

chmod u+x rsync.sh

Add to crontab -e (this command runs it a 2am DAILY)

0 2 * * * /home/tjay/my-scripts/rsync.sh