wildcard error in source path?

Terry Dooher tdooher.lists at naturalmotion.com
Fri Jun 18 09:29:45 GMT 2004


As you say, it does "delete files that don't exist on the sending side" 
and I can see why the behaviour looks wrong at first glance

The difference between dump/* and dump/ is the list of files you are 
giving to rsync in the first place.

With dump/*:

For each file in dump/, do {
	Comapre file with remote copy, and upload file or changes.
}

With dump/:

Get list files in local dump/
Get list of files in remote dump/
for each entry in remote list, do {
	If local counterpart doesn't exist, delete.
	Else compare local<->remote and upload file or changes.
}

The former method doesn't allow for the concept of missing local file. 
It's not broken, really, you're just asking it to do something else. If 
there are any subdirectories inside dump/ then --delete should work as 
you expect for those.

Is there a particular reason why you can't use "dump/"?

(Previous disclaimer still applies)

Terry.

Stuart Halliday wrote:

>>Logically, this is correct behaviour, I think.
>>
>>dump/* is a wildcard that matches every _existing_ local file in the 
>>dump/ directory. Since the file you deleted doesn't exist, it isn't 
>>considered by rsync.
>>
>>dump/  tells rsync to compare the contents of the local dump/ directory 
>>with those of the remote one and, in your case, will delete on the 
>>remote host any files that don't exist locally.
>>
>>Disclaimer: I haven't used --delete myself, so I could be wrong.
> 
> 
> 
> Yes your statement sounds logic. But the use of --delete is stated as being:
> 
> "delete files that don't exist on the sending side"
> 
> Which I assume means those on the remote side. 
> 
> Since it isn't deleting the file on the remote side then rsync is a touch broken.
> 



More information about the rsync mailing list