Copy local to local: --suffix is being ignored

What is the problem you are having with rclone?

The file get copied but the name remained untouched despite a --suffix being supplied
Config:
Windows 11
Powershell: 7.2.6
Windows Terminal: 1.15.2524.0

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

rclone v1.59.2

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

Local -> Local

The command you were trying to run (eg rclone copy /tmp remote:tmp)

As in the doc

rclone copy -i D:\.wor\test.txt D:\.wor\dest --suffix .bak 

A log from the command with the -vv flag

2022/09/27 13:59:54 DEBUG : rclone: Version "v1.59.2" starting with parameters ["C:\\ProgramData\\chocolatey\\lib\\rclone.portable\\tools\\rclone-v1.59.2-windows-amd64\\rclone.exe" "copy" "-i" "D:\\.wor\\test.txt" "D:\\.wor\\dest" "--suffix" ".bak" "-vv"]
2022/09/27 13:59:54 DEBUG : Creating backend with remote "D:\\.wor\\test.txt"
2022/09/27 13:59:54 DEBUG : Using config file from "C:\\Users\\XXXXXX\\AppData\\Roaming\\rclone\\rclone.conf"
2022/09/27 13:59:54 DEBUG : fs cache: adding new entry for parent of "D:\\.wor\\test.txt", "//?/D:/.wor"
2022/09/27 13:59:54 DEBUG : Creating backend with remote "D:\\.wor\\dest"
2022/09/27 13:59:54 DEBUG : fs cache: renaming cache item "D:\\.wor\\dest" to be canonical "//?/D:/.wor/dest"
2022/09/27 13:59:54 DEBUG : test.txt: Need to transfer - File not found at Destination
rclone: copy "test.txt"?
y) Yes, this is OK (default)
n) No, skip this
s) Skip all copy operations with no more questions
!) Do all copy operations with no more questions
q) Exit rclone now.
y/n/s/!/q> y
2022/09/27 13:59:57 DEBUG : test.txt: md5 = d41d8cd98f00b204e9800998ecf8427e OK
2022/09/27 13:59:57 INFO  : test.txt: Copied (new)
2022/09/27 13:59:57 NOTICE:
Transferred:              0 B / 0 B, -, 0 B/s, ETA -
Transferred:            1 / 1, 100%
Elapsed time:         2.3s

2022/09/27 13:59:57 DEBUG : 3 go routines active

The flag takes a file that exists on the destination and renames it if the file being copied changes.

So if you have a file called hosts and it's not on the destination, it copies the file.

felix@gemini:~$ rclone copy /etc/hosts /home/felix/test -vv
2022/09/27 08:41:10 DEBUG : Setting --config "/opt/rclone/rclone.conf" from environment variable RCLONE_CONFIG="/opt/rclone/rclone.conf"
2022/09/27 08:41:10 DEBUG : rclone: Version "v1.59.2" starting with parameters ["rclone" "copy" "/etc/hosts" "/home/felix/test" "-vv"]
2022/09/27 08:41:10 DEBUG : Creating backend with remote "/etc/hosts"
2022/09/27 08:41:10 DEBUG : Using config file from "/opt/rclone/rclone.conf"
2022/09/27 08:41:10 DEBUG : fs cache: adding new entry for parent of "/etc/hosts", "/etc"
2022/09/27 08:41:10 DEBUG : Creating backend with remote "/home/felix/test"
2022/09/27 08:41:10 DEBUG : hosts: Need to transfer - File not found at Destination
2022/09/27 08:41:10 DEBUG : hosts: md5 = a92e71e6827b56158fb6f593a9af443f OK
2022/09/27 08:41:10 INFO  : hosts: Copied (new)
2022/09/27 08:41:10 INFO  :
Transferred:   	        327 B / 327 B, 100%, 0 B/s, ETA -
Transferred:            1 / 1, 100%
Elapsed time:         0.0s

2022/09/27 08:41:10 DEBUG : 3 go routines active

If you change the source file and run the copy again.

felix@gemini:~$ rclone copy /etc/hosts /home/felix/test -vv --suffix *.bak
2022/09/27 08:41:30 DEBUG : Setting --config "/opt/rclone/rclone.conf" from environment variable RCLONE_CONFIG="/opt/rclone/rclone.conf"
2022/09/27 08:41:30 DEBUG : rclone: Version "v1.59.2" starting with parameters ["rclone" "copy" "/etc/hosts" "/home/felix/test" "-vv" "--suffix" "*.bak"]
2022/09/27 08:41:30 DEBUG : Creating backend with remote "/etc/hosts"
2022/09/27 08:41:30 DEBUG : Using config file from "/opt/rclone/rclone.conf"
2022/09/27 08:41:30 DEBUG : fs cache: adding new entry for parent of "/etc/hosts", "/etc"
2022/09/27 08:41:30 DEBUG : Creating backend with remote "/home/felix/test"
2022/09/27 08:41:30 DEBUG : hosts: Sizes differ (src 328 vs dst 327)
2022/09/27 08:41:30 INFO  : hosts: Moved (server-side) to: hosts*.bak
2022/09/27 08:41:30 DEBUG : hosts: md5 = e12c7e2a8f69f424fced25623fa85d4a OK
2022/09/27 08:41:30 INFO  : hosts: Copied (new)
2022/09/27 08:41:30 INFO  :
Transferred:   	        655 B / 655 B, 100%, 0 B/s, ETA -
Checks:                 1 / 1, 100%
Renamed:                1
Transferred:            1 / 1, 100%
Elapsed time:         0.0s

2022/09/27 08:41:30 DEBUG : 4 go routines active

You'd get output like this.

felix@gemini:~/test$ ls -al
total 8
drwxrwxr-x 1 felix felix  30 Sep 27 08:41  .
drwxr-xr-x 1 felix felix 270 Sep 26 20:32  ..
-rw-rw-r-- 1 felix felix 328 Sep 27 08:41  hosts
-rw-rw-r-- 1 felix felix 327 Sep 20 09:51 'hosts*.bak'

I'd probably change the suffix to be .bak :slight_smile:

felix@gemini:~/test$ rclone copy /etc/hosts /home/felix/test -vv --suffix .bak
2022/09/27 08:43:23 DEBUG : Setting --config "/opt/rclone/rclone.conf" from environment variable RCLONE_CONFIG="/opt/rclone/rclone.conf"
2022/09/27 08:43:23 DEBUG : rclone: Version "v1.59.2" starting with parameters ["rclone" "copy" "/etc/hosts" "/home/felix/test" "-vv" "--suffix" ".bak"]
2022/09/27 08:43:23 DEBUG : Creating backend with remote "/etc/hosts"
2022/09/27 08:43:23 DEBUG : Using config file from "/opt/rclone/rclone.conf"
2022/09/27 08:43:23 DEBUG : fs cache: adding new entry for parent of "/etc/hosts", "/etc"
2022/09/27 08:43:23 DEBUG : Creating backend with remote "/home/felix/test"
2022/09/27 08:43:23 DEBUG : hosts: Sizes differ (src 327 vs dst 328)
2022/09/27 08:43:23 INFO  : hosts: Moved (server-side) to: hosts.bak
2022/09/27 08:43:23 DEBUG : hosts: md5 = a92e71e6827b56158fb6f593a9af443f OK
2022/09/27 08:43:23 INFO  : hosts: Copied (new)
2022/09/27 08:43:23 INFO  :
Transferred:   	        655 B / 655 B, 100%, 0 B/s, ETA -
Checks:                 1 / 1, 100%
Renamed:                1
Transferred:            1 / 1, 100%
Elapsed time:         0.0s

2022/09/27 08:43:23 DEBUG : 4 go routines active
felix@gemini:~/test$ ls
hosts  hosts.bak

I see, I missed that subtility. Thanks for your very clear and detailed answer :+1:t2:

1 Like

hi, might try
rclone copyto D:\.wor\test.txt D:\.wor\dest\test.txt.bak

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