How to understand error code of rsync?

The error code of rsync is similar to UNIX/Linux system error code, and it has different meanings which makes it confusing. How can we understand the meanings of error code of rsync?

Well, rsync’s manual page explains this well, and you can get below list from “man rsync” easily

  • 0 Success
  • 1 Syntax or usage error
  • 2 Protocol incompatibility
  • 3 Errors selecting input/output files, dirs
  • 4 Requested action not supported: an attempt was made to manipulate 64-bit files on a platform that cannot support them; or an option was specified that is supported by the client and not by the server.
  • 5 Error starting client-server protocol
  • 6 Daemon unable to append to log-file
  • 10 Error in socket I/O
  • 11 Error in file I/O
  • 12 Error in rsync protocol data stream
  • 13 Errors with program diagnostics
  • 14 Error in IPC code
  • 20 Received SIGUSR1 or SIGINT
  • 21 Some error returned by waitpid()
  • 22 Error allocating core memory buffers
  • 23 Partial transfer due to error
  • 24 Partial transfer due to vanished source files
  • 25 The –max-delete limit stopped deletions
  • 30 Timeout in data send/receive
  • 35 Timeout waiting for daemon connection

With this list, you can easily identify rsync errors. For example,

2014-03-03 06:20:10,982 18607 47709421383568 152 ERROR : rsync:
change_dir "/opt/data/output/?/*" failed: No such file
or directory (2)

2014-03-03 06:20:10,983 18607 47709421383568 152 ERROR : rsync error:
some files/attrs were not transferred (see previous errors) (code 23) at
main.c(1532) [receiver=3.0.6]

This msg contains the code 23, which means not all the files are synced as some of them are not found.

Leave a comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.