Web lists-archives.com

Re: Question to rsync

Hash: SHA1

On Fri, Jun 22, 2018 at 11:04:43AM +0200, Hans wrote:
> Hi folks,
> I am looking for an option in rsync, which I can not find any more. I read the 
> manual, but in the manual I could nor find the optiuon I am looking for. 
> In earlier versions, there was rsync -av -d, where "-d" was the tag, which 
> did, what I wanted: I want to delete any files in the target,. when they are 
> not existing in the source.

As others have said, this is --delete. Options -d and -D are taken for other
things -- and I don't remember that "-d" has meant delete for quite a long
time (say 10 years or so).

> I am sure, this option stilll exists in the  actual rsync version, but I  can 
> not find it (although, there is a "--delete", but looks to do something else)

No, this is what you are looking for. As Teemu pointed out, the --delete-*
options are worth a look. For example, if you have big files (videos) which
you rename often at the source, you better use option -y. Then rsync tries
to use a suitable file at the target as basis instead of pushing the whole
thing through the wire. Now, if *that* file has been deleted before... bad
luck. So combining -y --delete-after (or better --delete-delay) can speed
up things significantly. Unless... you are memory constrained or your wire
is very fast.

Decisions, decisions...


- -- t
Version: GnuPG v1.4.12 (GNU/Linux)