rsync with the --delete option


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers rsync with the --delete option
# 1  
Old 10-19-2005
rsync with the --delete option

Tell me this - set me straight!

The --delete option says "delete files that don't exist on the sending side"

Does this mean and only mean that it will delete files from the DESTINATION that DON'T EXIST on the sending side? Smilie

Last edited by rbatte1; 11-04-2016 at 01:20 PM..
# 2  
Old 10-22-2005
Imagine this case.....


source: one.txt two.txt three.txt
destination: zero.txt one.txt

Rsync might need to freshen up one.txt. And it certainly needs to copy two.txt and three.txt. But this leaves the destination with an extra file --- zero.txt. So the destination is not really a perfect copy of the source. --delete says that zero.txt should be deleted.

And yes it will only be deleted from the destination. (Were you afraid that it might be deleted from the source? Smilie)
This User Gave Thanks to Perderabo For This Post:
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Rsync with --delete but do not delete peer dirs on target

rsync with --delete won't honor the delete if the source is something/*. I want the delete to work, but not to delete directories on the target that are peer to the intended directory. For example, using these source and target file structures: Source on desktop: ~/ Money/ ... (4 Replies)
Discussion started by: JavaMeister
4 Replies

2. Shell Programming and Scripting

Rsync with delete option

Hi, I have restored backup of a directory on one server to another server. But there may be some differences because the date on which backup was taken is 5 days back, so I want to delete the files on target if something is not in sync, but do not want to copy it all, since this is already... (1 Reply)
Discussion started by: solaris_1977
1 Replies

3. Shell Programming and Scripting

Synchronization, rsync option

Dear all, I am synchronizing some files on 2 hosts. host2 is a backup server of host1, but can have some more up to date files. I use on host2: rsync -auv usrer@host1:/Source_Dir Dest_DirOption -u (update) will copy and replace the newest files from host2 to host1. Before this is done I... (1 Reply)
Discussion started by: freddie50
1 Replies

4. Shell Programming and Scripting

sed delete option

I have tried doing this to delete some lines: sed '1,10d' file Now I want to specify a variable as a line number for example: lastline=wc -l file linestart=$lastline - 20 sed '$linestart,$lastlined' file but this will give error: sed: -e expression #1, char 3: extra characters after... (4 Replies)
Discussion started by: zorrox
4 Replies

5. Shell Programming and Scripting

Does rsync has option to backup only new updates files on different dir

Hi I would like to ask if rsync has an option of backing up the new or updated files on different destination dir( only the new or updated files will be copied to the a different dir) just like option --backup-dir but this is for backup files. Thanks for any response. (1 Reply)
Discussion started by: jao_madn
1 Replies

6. Fedora

rsync --delete

When I try to back up my libraries with rsync -azv --delete -e ssh /home/sarah/ saga:/home/sarah/bupembladaily/ I get error message rsync: readlink_stat("/home/sarah/.gvfs") failed: Permission denied (13) FATAL I/O ERROR: dying to avoid a --delete-during issue with a pre-3.0.7 receiver.... (7 Replies)
Discussion started by: sarahslagstedt
7 Replies

7. Shell Programming and Scripting

rsync question (regarding --delete)

Hi there Does anybody know of a way that i can, instead of issuing a --delete when syncing one directory to another, I can instead somehow receive a list of what would be deleted, but not actually delete it ? basically, people are occasionally putting files into one of synced folders, but... (2 Replies)
Discussion started by: rethink
2 Replies

8. Shell Programming and Scripting

rsync exclude option

Hi Frdz, i am using rsync to transfer files from source to destination. but i have one criteria like i have to tranfer only links from source to destination. in home/test/po folder i have kiran/test1 -> /home/test/lo/fg kiran/test2 -> /home/test/lo/fg2 like links are available.... (1 Reply)
Discussion started by: KiranKumarKarre
1 Replies

9. Shell Programming and Scripting

Bash rsync but move not delete

There might be an easy solution to my problem, or maybe not, but here it is. I am trying to rsync a Volume with 1.5 terabytes of data and send it via fibre channel to a raid array. Now normally when I rsync it scans through everything and, before copying anything, deletes any files that have... (1 Reply)
Discussion started by: Movomito
1 Replies

10. UNIX for Advanced & Expert Users

rsync with the --delete option.

Tell me this - set me straight! the --delete option says "delete files that don't exist on the sending side" Does this mean and only mean that it will delete files from the DESTINATION that DON'T EXIST on the sending side? :confused: (2 Replies)
Discussion started by: sallender
2 Replies
Login or Register to Ask a Question