LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 09-30-2007, 06:25 AM   #1
Fill
Member
 
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
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983
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
Fill
Member
 
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
 
  


Reply



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

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:00 PM.

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
Open Source Consulting | Domain Registration