rsync commands and how I backup
I run the following command when I want to just update one directory to another. It only copies files that have changed. If any files have been deleted from A they still exists in directory B. The trailing slash after A/ is necessary to tell rsync to move the contents. Otherwise A will create a folder in B called /media/B/A and move the files over.
I run the following command when I want to mirror one directory to another. Any files that are deleted from A are also deleted from B. Only modified files in A are moved to B.
This command is similar to the last command but it excludes certain files/types.
I utilize those commands on a schedule with crontab -e.
Basically that command runs every Wednesday and Saturday at 3am. This is pretty easy to use.
rsync -ruptv /media/A/ /media/B
rsync -ruptv --delete /media/A/ /media/B
rsync -ruptv --delete --exclude=Thumbs.db /media/A/ /media/raid/B
0 3 * * 3,6 /home/sam/backup.sh
Total Comments 0