Yaroslav Halchenko
2005-May-09 16:07 UTC
how to abort when can't write to the destination?
Dear Rsyncers, I'm trying to maintain a mirror of Ubuntu distribution and I had a cron job which rsynced it every night. The problem came after last reboot a few days ago -- destination directory wasn't mounted, thus wasn't accessible by rsync for writing: rsync: failed to set times on "/share/ubumirror/.": Operation not permitted (1) rsync: recv_generator: mkdir "/share/ubumirror/dists" failed: Permission denied (13) rsync: stat "/share/ubumirror/dists" failed: No such file or directory (2) rsync: recv_generator: mkdir "/share/ubumirror/dists/breezy" failed: No such file or directory (2) rsync: stat "/share/ubumirror/dists/breezy" failed: No such file or directory (2) rsync: recv_generator: mkdir "/share/ubumirror/dists/breezy-security" failed: No such file or directory (2) but it kept causing all the traffic to occur and because local files weren't present it happened to cause the transfer of a while ubuntu mirror every night for the last few days. I man-ed rsync but couldn't find an option which would exit rsync if any error occurred on the way (like IO problem with destination or smth like that) What would be a proper way for me to set it up? (Besides piping stderr to a process which would kill rsync if gets anything) Please CC me - I'm not on the list Thank you in advance for ideas! -- Yaroslav Halchenko Research Assistant, Psychology Department, Rutgers-Newark Office: (973) 353-5440x263 | FWD: 82823 | Fax: (973) 353-1171 101 Warren Str, Smith Hall, Rm 4-105, Newark NJ 07105 Student Ph.D. @ CS Dept. NJIT
On Mon, May 09, 2005 at 12:07:39PM -0400, Yaroslav Halchenko wrote:> I man-ed rsync but couldn't find an option which would exit rsync if > any error occurred on the way (like IO problem with destination or > smth like that)That's not currently supported, but this is an area that needs to be improved in the future. You could try running a probing rsync that only copies one file/dir, and if it doesn't succeed, skip doing the full update. ..wayne..