rsync icon indicating copy to clipboard operation
rsync copied to clipboard

Feature Request: More differentiated exit values

Open mgutt opened this issue 3 years ago • 0 comments

I made several tests with rsync and had over the time different errors as follows:

Provided the wrong source path (= "huge error"):

rsync: link_stat "/mnt/disks/DESKTOP-I0HHMD9_*" failed: No such file or directory (2)

Provided a file instead of the path to --link-dest (= "huge error"):

rsync: change_dir "/usr/local/emhttp//\#012    /mnt/disks/DESKTOP-I0HHMD9_Desktop\#012    /mnt/disks" failed: No such file or directory (2)
--link-dest arg is not a dir: /mnt/user/Backup/plex-2020-10-02-cache-disk.tar.gz

One of 200k files can't be read, because of missing permission (= "soft error"):

rsync: readdir("/mnt/disks/DESKTOP-I0HHMD9_Documents/Eigene Bilder"): Permission denied (13)

And all of them return this exit value:

rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1189) [sender=3.1.3]

What I expect:

More detailed error sentences like:

rsync error: 1 of 200,000 files/attrs were not transferred because of permission errors (see previous errors) (code 26) at main.c(1189) [sender=3.1.3]

or if the source path was wrong:

rsync error: no files/attrs were transferred (see previous errors) (code 27) at main.c(1189) [sender=3.1.3]

or if multiple errors happen:

rsync error: 9 of 500,000 files/attrs were not transferred because of permission errors (see previous errors) (code 26) at main.c(1189) [sender=3.1.3]
rsync warning: 3 of 500,000 files vanished before they could be transferred (code 24) at main.c(1189) [sender=3.1.3]

Or it will be added to the --stats summary as follows:

Number of files: 200,000 (reg: 190,000, dir: 10,000)
Number of created files: 199,995 (reg: 189,995, dir: 10,000)
Number of deleted files: 0
Number of regular files transferred: 199,995
Number of skipped files (vanished): 2
Number of skipped files (permission): 3

mgutt avatar Nov 04 '20 23:11 mgutt