Latest LQ Deal: Linux Power User Bundle
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 09-30-2007, 06:25 AM   #1
Registered: Jun 2007
Posts: 96

Rep: Reputation: 16
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
Old 09-30-2007, 07:02 AM   #2
LQ Guru
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978
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.

Last edited by colucix; 09-30-2007 at 07:03 AM.
Old 10-01-2007, 04:30 PM   #3
Registered: Jun 2007
Posts: 96

Original Poster
Rep: Reputation: 16
"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


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
rsync question mkhan919 Linux - Newbie 10 03-12-2007 11:42 AM
Rsync Question stefaandk Linux - General 2 05-12-2006 11:12 PM
rsync question juanb Linux - General 10 01-28-2006 03:18 PM
Question about rsync bgriesi Linux - Networking 4 12-31-2004 08:19 AM
rsync question falco365 Programming 4 05-25-2003 09:24 AM

All times are GMT -5. The time now is 02:41 AM.

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