Can 'copyto' update timestamps like 'sync'?

What is the problem you are having with rclone?

I am using 'rclone copyto' to update files on an encrypted remote (Google Drive) individually as they are modified:

rclone copyto --drive-use-trash=false /media/Shell/Cmder/config/clink.log gsecret:Shell/Cmder/config/clink.log

After updating the local file, I run 'rclone lsl gsecret:Shell/Cmder/config/clink.log` and get the following result:

11009 2022-09-11 09:31:13.142000000 clink.log

An 'rclone cryptcheck' reports that there are no differences:

2022-09-11 09:29:11 NOTICE: Encrypted drive 'gsecret:Shell': 0 differences found
2022-09-11 09:29:11 NOTICE: Encrypted drive 'gsecret:Shell': 67 matching files
Transferred: 0 B / 0 B, -, 0 B/s, ETA -
Checks: 67 / 67, 100%
Elapsed time: 5.2s

However, if I subsequently run 'rclone sync' on the folder, it transfers the file again:

2022-09-11 09:32:29 INFO : Cmder/config/clink.log: Copied (replaced existing)
Transferred: 10.798 KiB / 10.798 KiB, 100%, 0 B/s, ETA -
Checks: 67 / 67, 100%
Transferred: 1 / 1, 100%
Elapsed time: 2.2s
2022/09/11 09:32:29 INFO :
Transferred: 10.798 KiB / 10.798 KiB, 100%, 0 B/s, ETA -
Checks: 67 / 67, 100%
Transferred: 1 / 1, 100%
Elapsed time: 2.2s

Running another 'rclone lsl' shows that the timestamp of the file has been changed by the 'sync':

11009 2022-09-11 09:30:51.000000000 clink.log

This means that if I do a full sync as maintenance, every file that has been updated since the last 'rclone sync' will be transferred again because time stamps differ. Very inefficient use of bandwidth.

Is there a way to get 'copyto' to set the timestamp on the remote file to that of the local file the same way 'sync' does?

Run the command 'rclone version' and share the full output of the command.

rclone v1.59.1

  • os/version: debian 10.12 (64 bit)
  • os/kernel: 4.19.0-17-amd64 (x86_64)
  • os/type: linux
  • os/arch: amd64
  • go/version: go1.18.5
  • go/linking: static
  • go/tags: none

Are you on the latest version of rclone? You can validate by checking the version listed here: Rclone downloads

Yes.

Which cloud storage system are you using? (eg Google Drive)

Google Drive (encrypted)

(not including the remaining items because they are not relevant here.)

This sounds strange to me, I would like to see the output from this command sequence:

rclone lsl /media/Shell/Cmder/config/clink.log
rclone lsl gsecret:Shell/Cmder/config/clink.log
rclone copyto --drive-use-trash=false /media/Shell/Cmder/config/clink.log gsecret:Shell/Cmder/config/clink.log -v
rclone lsl /media/Shell/Cmder/config/clink.log
rclone lsl gsecret:Shell/Cmder/config/clink.log
rclone sync --drive-use-trash=false /media/Shell/Cmder/config gsecret:Shell/Cmder/config --include="clink.log" -v
rclone lsl /media/Shell/Cmder/config/clink.log
rclone lsl gsecret:Shell/Cmder/config/clink.log

Running through your commands, I discovered that the issue doesn't reproduce. The timestamps end up being identical on both ends (which made me very happy). rclone is obviously not involved here.

My suspicion now is that I am triggering the rclone sync too soon, before the file is completely updated. I will pursue this further. Thanks for your reply, Ole, and for verifying the expected behavior.

Glad to hear

Hope you easily find the root cause and a good solution.

You are welcome, thanks for reporting back!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.