my ego thanks you very much and in repay, it might have found a permanent solution to the problem.
- no need to use
--modify-window
and forever deal with modtime mismatches.
- if you were to forget
--modify-window
, then that would trigger rclone to re-copy every single file.
my freshly stroked ego will not let that happen to you.
tl;dr - the permanent solution
a one time copy from newremote to local, rclone will see the modtime mismatch.
rclone will be able to change the modtime on local to match the modtime on newremote, without triggering a re-copy.
after that rclone copy from local to newremote, the modtimes will match and no need to worry about forgetting --modify-window
for me, i found this an excellent use-case, with many moving parts; i enjoyed working thru it.
-
three storage systems
--- local
--- oldremote: which is one of the following onedrive, box or pcloud
--- newremote: koofr
-
three modtime window resolutions,
--- 10ns - local on windows, 1ns on linux.
--- 1s - oldremote -> which is one of the following onedrive, box or pcloud
--- 1ms - newremote -> koofr
-
two hash types
--- sha1/md5 - local
--- sha1 - oldremote -> which is one of the following onedrive, box or pcloud
--- md5 - newremote -> koofr
-
multiple copy operations, with different modtime resolutions
--- local to oldremote -> 10ns to 1s
--- oldremote to newremote -> 1s to 1ms
--- local to newremote -> 1ms to 10ns
in the end, we were left with a set of files on local and newremote.
--- same hashes
--- different modtimes
the workaround is to use --modify-window
.
here is your current situation, copying a file from local to newremote and dealing with the modtime mismatch
with --dry-run
- rclone sees that the hashes match, but modtime is different, rclone wants to update modtime
rclone copy file.txt newremote: -vv --dry-run
DEBUG : file.txt: Modification times differ by -759.2967ms: 2021-08-24 16:10:57.7592967 -0400 EDT, 2021-08-24 16:10:57 -0400 EDT
DEBUG : file.txt: md5 = 898a314f5208bb3d0eec9280c3793acf OK
NOTICE: file.txt: Skipped update modification time as --dry-run is set (size 275)
DEBUG : file.txt: Unchanged skipping
without --dry-run
- same as last test - rclone sees that the hashes match, but modtime is different, rclone wants to update modtime.
time to cue the scary music...
but with koofr, once a file is uploaded, the modtime cannot be changed without re-copying the file.
rclone will re-copy the file to get modtimes to match,
rclone copy file.txt newremote: -vv
DEBUG : file.txt: Modification times differ by -759.2967ms: 2021-08-24 16:10:57.7592967 -0400 EDT, 2021-08-24 16:10:57 -0400 EDT
DEBUG : file.txt: md5 = 898a314f5208bb3d0eec9280c3793acf OK
NOTICE: koofr:c6c75a7c-f8ae-0044-bb82-f74bb377d285:testfolder01: Forced to upload files to set modification times on this backend.
INFO : file.txt: src and dst identical but can't set mod time without deleting and re-uploading
DEBUG : file.txt: md5 = 898a314f5208bb3d0eec9280c3793acf OK
INFO : file.txt: Copied (replaced existing)
here are the test i did to confirm the permanent solution.
rclone delete newremote:testfolder01 -v
2021/09/06 16:01:59 INFO : file.txt: Deleted
rclone delete oldremote:testfolder01 -v
2021/09/06 16:02:02 INFO : file.txt: Deleted
rclone copy file.txt oldremote:testfolder01 -v
2021/09/06 16:02:07 INFO : file.txt: Copied (new)
rclone copy oldremote:testfolder01 newremote:testfolder01 -v
2021/09/06 16:02:10 INFO : file.txt: Copied (new)
rclone lsl file.txt
275 2000-01-01 01:01:01.100000000 file.txt
rclone lsl oldremote:testfolder01
275 2000-01-01 01:01:01.000000000 file.txt
rclone lsl newremote:testfolder01
275 2000-01-01 01:01:01.000000000 file.txt
rclone copy newremote:testfolder01 .\source -vv --dry-run
DEBUG : file.txt: Modification times differ by 100ms: 2000-01-01 01:01:01 -0500 EST, 2000-01-01 01:01:01.1 -0500 EST
DEBUG : file.txt: md5 = 898a314f5208bb3d0eec9280c3793acf OK
NOTICE: file.txt: Skipped update modification time as --dry-run is set (size 275)
DEBUG : file.txt: Unchanged skipping
rclone copy newremote:testfolder01 .\source -vv
DEBUG : file.txt: Modification times differ by 100ms: 2000-01-01 01:01:01 -0500 EST, 2000-01-01 01:01:01.1 -0500 EST
DEBUG : file.txt: md5 = 898a314f5208bb3d0eec9280c3793acf OK
INFO : file.txt: Updated modification time in destination
DEBUG : file.txt: Unchanged skipping
rclone copy newremote:testfolder01 .\source -vv
DEBUG : file.txt: Size and modification time the same (differ by 0s, within tolerance 1ms)
DEBUG : file.txt: Unchanged skipping
INFO : There was nothing to transfer
rclone lsl file.txt
275 2000-01-01 01:01:01.000000000 file.txt
rclone lsl oldremote:testfolder01
275 2000-01-01 01:01:01.000000000 file.txt
rclone lsl newremote:testfolder01
275 2000-01-01 01:01:01.000000000 file.txt