nick34992 of Bash
2/2/2017 - 7:15 AM

Unix Linux Bash RSync Backup from File Directory to Backup Directory

Unix Linux Bash RSync Backup from File Directory to Backup Directory

#!/usr/bin/bash
# `--delete` flag: if a file is deleted from the file dir, 
# the backed up copy is deleted from the backup dir
# `--archive` flag: `--recursive --links --perms --times --group --owner --devices`
# http://ss64.com/bash/rsync_options.html

rsync --archive --verbose --delete /home/nick/Documents/ /media/nick/BACKUP/Documents/
rsync --archive --verbose --delete /home/nick/Pictures/  /media/nick/BACKUP/Pictures/