LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Blogs > sag47
User Name
Password

Notices

Rate this Entry

rsync commands and how I backup

Posted 06-23-2011 at 05:06 PM by sag47
Updated 06-23-2011 at 05:07 PM by sag47

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.

Code:
rsync -ruptv /media/A/ /media/B
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.

Code:
rsync -ruptv --delete /media/A/ /media/B
This command is similar to the last command but it excludes certain files/types.

Code:
rsync -ruptv --delete --exclude=Thumbs.db /media/A/ /media/raid/B
I utilize those commands on a schedule with crontab -e.
Code:
0 3 * * 3,6 /home/sam/backup.sh
Basically that command runs every Wednesday and Saturday at 3am. This is pretty easy to use.

SAM
Posted in Uncategorized
Views 678 Comments 0
« Prev     Main     Next »
Total Comments 0

Comments

 

  



All times are GMT -5. The time now is 06:44 AM.

Main Menu
Advertisement

My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration