rsync icon indicating copy to clipboard operation
rsync copied to clipboard

optional verbosity when deleting files from destination

Open mherkazandjian opened this issue 3 years ago • 2 comments

Hi,

I heard several people (new users to rsync) complain about getting confused when rsync is executed to sync e.g two dirs. When a file does not exist in "source" but exists in the "destination" the path of the deleted file is mentioned a bit ambiguously. This could be indeed confusing for someone who does not use rsync much. The following snippets demonstrates what i am trying to explain:

mkdir dir1 
touch dir1/foo
touch dir1/bar

rsync -PrlHvtpog --delete dir1 /tmp/ 

rsync dumps the following output to stdout

rsync -PrlHvtpog --delete dir1 /tmp/                           
sending incremental file list                                  
dir1/                                                          
dir1/bar                                                       
              0 100%    0.00kB/s    0:00:00 (xfr#1, to-chk=1/3)
dir1/foo                                                       
              0 100%    0.00kB/s    0:00:00 (xfr#2, to-chk=0/3)
                                                               
sent 187 bytes  received 58 bytes  490.00 bytes/sec            
total size is 0  speedup is 0.00                               

now i delete "foo" from the source dir (dir1) and run rsync again

rm -f dir1/foo
rsync -PrlHvtpog --delete dir1 /tmp/ 

and i get the following output

sending incremental file list                      
deleting dir1/foo        <<<< this is the confusing part it would be nice to have this as "deleting /tmp/dir1/foo"
dir1/                                              
                                                   
sent 94 bytes  received 28 bytes  244.00 bytes/sec 
total size is 0  speedup is 0.00                   

is this something that can be enabled by default or better enable this with a flag such as '--show-remote-change-path' or something of that sort

tnx.

mherkazandjian avatar Aug 03 '22 14:08 mherkazandjian

Every file name mentioned is relative to the top of the transfer. Given a destination dir of /tmp the receiving side's deletions are always relative to that.

WayneD avatar Aug 03 '22 15:08 WayneD

so no change of implementing the option of displaying the full path upon demand through a command line flag?

mherkazandjian avatar Aug 03 '22 16:08 mherkazandjian