Rsync: failed to set times on
How to fix failed to set times on error from Rsync
The "failed to set times on, Operation not permitted (1)" error might appear if the destination folder doesn't have the correct permissions. Or if the destination folder is on the NFS file system.
The error looks like this:
rsync: failed to set times on "/destination_folder": Operation not permitted (1)
Check folder permissions
Check that the destination folder has the correct permissions.
The user running the Rsync command should own the destination folder:
$ chown -R username /destination_folder
Don't add modification times
Avoid setting modification times on the transferred times:
Add the
-O
for
--omit-dir-times
to the rsync command. This will not set modification times on the directories that are being transferred:
$ rsync -O SOURCE_FOLDER DESTINATION_FOLDER
Alternative:
$ rsync -crlt /source_directory USER@HOST:destination_directory
The
crlt
options are described like this:
Option | Description |
---|---|
-r | Recursive |
-l | Preserves links |
-c | Syncs based on file checksum |
-t | Preserves modification times |