What is the problem you are having with rclone?
The copyto
command clobbers remote directories if there is no trailing slash and the file being copied doesn't exist in the remote directory. I checked the rclone changelog, and I don't see any relevant bug fixes for this problem.
Basically, when there is a file in the remote directory with a matching name, then the command will function as expected, comparing the hash and date and performing a copy operation only if a change is detected.
However, when there is not a file in the remote directory with a matching name, then the command compares the hash, size, and date of the remote directory itself (which it obviously finds is different) and replaces the remote directory with a copy of the file. No warning is given about clobbering the remote directory.
Stranger still, by deleting the copied file and recreating the remote directory, then all of its former contents are restored which suggests it wasn't really purged from the server (thank goodness), only the link was removed.
I understand that copyto
is a comparatively newer command than copy
, but it would appear that it's still too experimental for use in a production environment given this type of undocumented behavior.
Run the command 'rclone version' and share the full output of the command.
rclone v1.49.2
- os/arch: linux/386
- go version: go1.12.9
Which cloud storage system are you using? (eg Google Drive)
PCloud
The command you were trying to run (eg rclone copy /tmp remote:tmp
)
rclone /pub/worlds/test/map.sqlite.gz remote:xlhost/testbak
The rclone config contents with secrets removed.
[remote]
type = pcloud
token = {"access_token":"REMOVED","token_type":"bearer","expiry":"0001-01-01T00:00:00Z"}
A log from the command with the -vv
flag
2022/01/04 20:50:52 DEBUG : rclone: Version "v1.49.2" starting with parameters ["rclone" "-vv" "copyto" "map.sqlite.gz" "remote:xlhost/testbak"]
2022/01/04 20:50:52 DEBUG : Using config file from "/root/.config/rclone/rclone.conf"
2022/01/04 20:50:52 DEBUG : map.sqlite.gz: Sizes differ (src 2539 vs dst 15716352)
2022/01/04 20:50:53 DEBUG : map.sqlite.gz: MD5 = 4724a898fc69696f47a185e9f5ce7e50 OK
2022/01/04 20:50:53 INFO : map.sqlite.gz: Copied (replaced existing)
2022/01/04 20:50:53 INFO :
Transferred: 2.479k / 2.479 kBytes, 100%, 3.479 kBytes/s, ETA 0s
Errors: 0
Checks: 0 / 0, -
Transferred: 1 / 1, 100%
Elapsed time: 700ms
2022/01/04 20:50:53 DEBUG : 4 go routines active
2022/01/04 20:50:53 DEBUG : rclone: Version "v1.49.2" finishing with parameters ["rclone" "-vv" "copyto" "map.sqlite.gz" "remote:xlhost/testbak"]