You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
--abort-if 0
If there are no files present in source do not delete files in dest.
--abort-if 10
If there are less then 10 files in source do not delete files in dest.
rsync
max-delete=NUM
This tells rsync not to delete more than NUM files or directo‐
ries. If that limit is exceeded, all further deletions are
skipped through the end of the transfer. At the end, rsync out‐
puts a warning (including a count of the skipped deletions) and
exits with an error code of 25 (unless some more important error
condition also occurred).
Beginning with version 3.0.0, you may specify --max-delete=0 to
be warned about any extraneous files in the destination without
removing any of them. Older clients interpreted this as "unlim‐
ited", so if you don’t know what version the client is, you can
use the less obvious --max-delete=-1 as a backward-compatible
way to specify that no deletions be allowed (though really old
versions didn’t warn when the limit was exceeded).
@craig-miskell-fluxfederation I see your point and as you noted, #952 (use copy instead of sync) is the best approach when you don't want your source files deleted.
@ishuah@craig-miskell-fluxfederation It's not relevant for my specific use case, though if you don't need to track renamed files between source and destination then yes, copy works fine.
I have a lot more files and data on the cloud than I can store locally, but it is much easier to batch rename (or move) local files and then "sync" those changes with the cloud.
I have a lot more files and data on the cloud than I can store locally, but it is much easier to batch rename (or move) local files and then "sync" those changes with the cloud.
I have a similar use case
Right now I use "sync --max-delete=0" but it ends with an errors, which looks confusing
2021-07-12 17:53:12 ERROR : Got fatal error on delete: --max-delete threshold reached
2021-07-12 17:53:12 ERROR : Cancelling sync due to fatal error: failed to delete 1 files
2021-07-12 17:53:12 ERROR : S3 bucket some-bucket: not deleting directories as there were IO errors
2021-07-12 17:53:12 ERROR : Fatal error received - not attempting retries
Transferred: 0 / 0 Bytes, -, 0 Bytes/s, ETA -
Errors: 2 (fatal error encountered)
Checks: 31 / 31, 100%
Deleted: 1 (files), 0 (dirs)
Elapsed time: 29.9s
2021/07/12 17:53:12 Failed to sync with 2 errors: last error was: failed to delete 1 files
I would prefer to add --delete-never to tell rclone just sync local files and do not try to delete
It only deletes files on the target due to a bug with detecting failed copies in an attempt to avoid leaving partial corrupted copies of files on some backends in certain circumstances, but the warning is still appreciated
v1.63 will no longer delete files on copy @asantoni@Masamune3210 - by default it will download to a .partial file and rename it if it is correct after the transfer.
Activity
7 remaining items
craig-miskell-fluxfederation commentedon Aug 23, 2018
Or is #952 relevant (use copy, not sync)?
ishuah commentedon Aug 24, 2018
@craig-miskell-fluxfederation I see your point and as you noted, #952 (use copy instead of sync) is the best approach when you don't want your source files deleted.
wlerin commentedon Aug 25, 2018
@ishuah @craig-miskell-fluxfederation It's not relevant for my specific use case, though if you don't need to track renamed files between source and destination then yes,
copyworks fine.I have a lot more files and data on the cloud than I can store locally, but it is much easier to batch rename (or move) local files and then "sync" those changes with the cloud.
olfway commentedon Jul 12, 2021
I have a similar use case
Right now I use "sync --max-delete=0" but it ends with an errors, which looks confusing
I would prefer to add --delete-never to tell rclone just sync local files and do not try to delete
Masamune3210 commentedon Jul 12, 2021
correct me if im misunderstanding, but a sync without deletes is just a copy right?
wlerin commentedon Jul 12, 2021
No. As already several times mentioned above,
--track-renamesonly works withsync.tooptoop4 commentedon May 22, 2023
this is important! i have found s3 copy between 2 buckets ends up doing server side copy and ALWAYS re-copies even though files were already same
asantoni commentedon Jun 6, 2023
Just to warn anyone who read what @ishuah and @Masamune3210 mentioned - rclone
copycan currently delete files, so be forewarned: #6142Masamune3210 commentedon Jun 6, 2023
It only deletes files on the target due to a bug with detecting failed copies in an attempt to avoid leaving partial corrupted copies of files on some backends in certain circumstances, but the warning is still appreciated
ncw commentedon Jun 7, 2023
v1.63 will no longer delete files on copy @asantoni @Masamune3210 - by default it will download to a
.partialfile and rename it if it is correct after the transfer.Masamune3210 commentedon Jun 7, 2023
Sweeeeeeeeet. I've been bit by that little grub before so it's nice to know it's no longer a issue.