can't delete older file/directory links on another local partitionafter `snapshot' type backup script

Dalton Harvie daltonh at ualberta.ca
Mon Mar 17 17:47:24 EST 2003


Well I think I've found out what the problem was here, but don't understand 
why.  Something to do with include/exclude pattern though (surprise, 
surprise).

As I see it.... Basically all these commands should (and tested, do) transfer 
the same files, only everything under /root/tmp/test plus these directories.

(1)
rsync -avvR --delete --delete-excluded --include "/root/" --include 
"/root/tmp/" --include "/root/tmp/test/" --include "/root/tmp/test/**" 
--exclude "*" /* /old

(2)
rsync -avvR --delete --delete-excluded --include "/" --include "/." --include 
"/root/" --include "/root/tmp/" --include "/root/tmp/test/" --include 
"/root/tmp/test/**" --exclude "*" / /old

(3)
rsync -avvR --delete --delete-excluded --include "/root/." --include 
"/root/" --include "/root/tmp/" --include "/root/tmp/test/" --include 
"/root/tmp/test/**" --exclude "*" /root/ /old;  

However, command (2) doesn't delete excluded files (if they already exist in 
the /old tree) whereas (1) and (3) do.  No clues in the output as to why.  
Seems strange to me as commands (2) and (3) use the same logic, just that (3) 
is based at /root/, (2) at /.  Is there something special about '/'?

Also, the logic in (3) of why "/root/." has to be included as well as 
"/root/" seems strange as you don't have to include other directories in this 
fashion, ie, you don't have to include '/root/tmp/.' as well as '/root/tmp/'?

Thanks.


More information about the rsync mailing list