When using rsync, a widely used tool to synchronize files and directories from one location to another while minimizing data transfer using delta encoding when appropriate, you may encounter the error “rsync error: some files/attrs were not transferred.” The error message associated with this may be “rsync warning: some files vanished before they could be transferred.” This error and warning often come with an exit code 23 or 24. There are a few possible reasons for these errors:
1. Files that are being synced were changed during the rsync operation; this could be from an operating system update, a user changing a file, etc.
1. Files are “vanished” or deleted during the operation.
1. You don’t have sufficient permissions to transfer or access some files.
1. There are input/output (I/O) issues, potentially due to a failing disk.
Here are some solutions based on these potential reasons:
1. If the error occurred due to changes made during the sync operation, it’s best to re-run your rsync command. Before trying again, ensure that no changes will be made during the next attempt.
1. If files are being deleted midway through the process, investigate why this might be occurring. Check if any cleanup tasks or scripts are running concurrently which might be affecting your files.
1. For permission issues, check that you have read access to all the source files and write access at the destination. If required, use ‘sudo’ before your rsync command, but be cautious about running as root. A better approach would be to change the ownership of the files or adding the user to a group that has permission.
1. Hardware issues or failure could also result in rsync error. If you suspect a failing disk, try running a disk diagnostic tool such as ‘fsck’ or ‘smartmontools’ on Unix-based systems or ‘chkdsk’ on Windows.
Lastly, you can use rsync’s more verbose flags to try and get more information about the error:
‘rsync -avhin —progress’, where ‘a’ stands for all, ‘v’ for verbose, ‘h’ for human-readable, ‘i’ for itemize changes, and ‘n’ for dry-run, this shows what would have been transferred.
This information is drawn from multiple sources including rsync’s official documentation (https://rsync.samba.org/) and helpful troubleshooting discussions in Linux forums as in (https://serverfault.com/questions/115945/when-to-use-rsyncs-delete-flag) and (https://askubuntu.com/questions/30673/backup-files-with-rsync-preserve-permissions-user-group-owner-recursive). Further, make sure to check the disk space availability on the destination disk. Running out of space during the operation can cause failure as well. Always remember to have a proper backup before performing any data moving operations.