LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (http://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Rsync question (http://www.linuxquestions.org/questions/linux-newbie-8/rsync-question-588365/)

Fill 09-30-2007 07:25 AM

Rsync question
 
Hi, I'm using rsync since yesterday, so I have some doubts that would like to see asnwered.

I'm using rsync to copy my data to an external Hard Disk, with NO compression, just to sync my computer disk with my external disk.

Actually, my doubts are:

-> If I create a new file, when I run rsync, it copies the new file to my external disk - yes, that's the point. However, rsync is not deleting the files that I deleted on my computer disk. For example, I delete file1.conf from /home/filipe and when I run rsync he copies all the new files I've created but doesn't delete file1.conf from the external hard disk files. Is there any option I can use to make rsync delete all the files that are not on the source folder, but are in the destination folder?

-> The same happens with moved files. If I move file1.conf from /home/filipe to /home/filipe/test, after running rsync, in the external hard disk I see rsync copied file1.conf to /home/filipe/test - all right - but another copy of file1.conf is still in /home/filipe. So he's not deleting the files that are not on the destination folder.

Any suggestion guys?
Thanks in advance ...

P.S.: Yes, I've already read rsync's man page, but didn't understand a few commands. I think that '--delete' option is what I need to use to get this problem resolved, am I right? I just didn't use because I'm afraid of rsync delete files in my source home directory ... so here I am to ask for your opinion ;)

colucix 09-30-2007 08:02 AM

The --delete option will remove the deleted files on the destination directory only. I suggest to do some experiments with a test (dummy) directory. Also you may use --delete in conjunction with -b (backup option) and --backup-dir, specifying a location where deleted files will be safely copied for further checks.

Fill 10-01-2007 05:30 PM

"The --delete option will remove the deleted files on the destination directory only."

Isn't that what I want?

Anyway I'm going to test with a dummy directory like you suggested.

Thanks for your answer

See ya


All times are GMT -5. The time now is 08:49 PM.