return status and non-regular files?

Marc Sarrel Marc.A.Sarrel at jpl.nasa.gov
Fri May 16 07:56:45 EST 2003


Recently, I ran rsync and got the following message:

skipping non-regular file "981005_plteph-de405s.bsp"

It turns out that the file in question is really a degenerate link 
that points back to itself.

lrwxr-xr-x   1 18450    other         24 May  9 20:38 
981005_plteph-de405s.bsp -> 981005_PLTEPH-DE405S.bsp

The confusing this is that although rsync printed what looks like an 
error, it still returned a status of zero (i.e. success).

My question is:  what should rsync do in such a case?  The options I see are:

1) create the degenerate link on the remote machine (with or without 
a warning) and return a status of zero.

2) don't create the degenerate link on the remote machine, print an 
error message and return a status other than zero.

The degenerate link was simply a mistake on our part.  But, the only 
reason I caught it was that I happened to see the error message 
buried in several hundred lines of verbose output.  My script checks 
the return status of rsync, but in this case, it indicated success 
even though rsync didn't copy the degenerate link.

Also, it doesn't seem outrageous that someone, somewhere would intend 
to create such a degenerate link.  In that case, what should rsync 
do?  Considering this case, I would tend to favor option one above 
even though that means I wouldn't have had any indication of an error.

Are there any other cases like this where rsync doesn't copy 
something from the source to the destination, prints a warning but 
still returns success?

For reference, my command line looks like this.

rsync --verbose --checksum --recursive --copy-unsafe-links --times 
--rsh=ssh --rsync-path=/usr/local/bin/rsync --delete --timeout=30 
--ignore-times --compress /source/directory 
user at machine:/destination/directory

Marc
-- 



More information about the rsync mailing list