M BUZZ CRAZE NEWS
// news

Can rsync be configured to NOT return code 23 on exit when a file is successfully transferred after a retry?

By David Jones

I have a script that, among other things, rsyncs files from one host to another. Sometimes during this rsync process, I get errors like this:

2019/07/19 15:03:26 [22635] <f..T...... reps/images/image_1.jpg
2019/07/19 15:03:26 [22635] rsync: read errors mapping "/home/blah/blah/fake/path/reps/images/image_1.jpg": No data available (61)
2019/07/19 15:03:26 [22635] <f..T...... reps/images/image_2.jpg
2019/07/19 15:03:26 [22635] rsync: read errors mapping "/home/blah/blah/fake/path/reps/imges/image_2.jpg": No data available (61)

A little further down in the log output, it retries:

2019/07/19 15:04:01 [22635] WARNING: reps/images/image_1.jpg failed verification -- update discarded (will try again).
...
2019/07/19 15:04:02 [22635] WARNING: reps/images/image_2.jpg failed verification -- update discarded (will try again).
...
2019/07/19 15:04:03 [22635] <f..T...... reps/images/image_1.jpg
2019/07/19 15:04:03 [22635] <f..T...... reps/images/image_2.jpg

This indicates to me that the files were successfully transferred the second time around, but rsync still exits with code 23, indicating an error.

If the retry was successful, I'd like my script to carry on and complete its tasks. If the 23 is (more) legimate, for instance some other error, the script should stop. I know I can loop if there's an 23 code, but is there anything else I can do that's faster? Does anyone know why rsync still exits with 23 in this particular case?

Reset to default

Know someone who can answer? Share a link to this question via email, Twitter, or Facebook.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy