Rclone move renaming files?

So I discovered to day that rclone move has been deleting a bunch of files.
I think because sometimes the local files have the same name. Is their a way to force rclone to just rename files if they happen to have the same name instead of pushing the original file to the trash.

It will say file xxx has been uploaded by rclone
then the next thing in my google drive logs will be
xxx has been moved into trash( the file with the same name)

So rclone is overwriting existing files on the destination when you do rclone move? This is expected behaviour.

Check out the –suffix flag and the –backup-dir flag - that is what you want I think.

Can I see an example of the command with suffix added to it.
also what kind of arguments can I pass to suffix
rclone sync /path/to/local remote:current --backup-dir remote:old

s all I see
would it be
rclone sync /path/to/local remote:current --backup-dir remote:old --suffix=?

You don’t need to use the --suffix if you don’t want to. If you set --backup-dir to the same as the destination, then you might set it to.bak for example.

Lots of people use --backup-dir with the current date and time, eg “–backup-dir remote:backup-`date -Is`”

1 Like

Hmm maybe I am making a synx mistake becaues it keeps saying I can’t get this to work
Using the command
rclone move /root/google/completed/CB gd:completed/CB --backup-dir gd:completed/CB --suffix=date
said files couldn’t overlamp

rclone move /root/google/completed/CB gd:completed/CB --backup-dir gd:completed/CB --‘date’
erroed out something about unknown commean

rclone move /root/google/completed/CB gd:completed/CB --backup-dir gd:completed/CB -‘date’
didn’t work either
Not sure how to fix this

also tried
rclone move /root/google/completed/CB gd:completed/CB --backup-dir gd:completed/CB -‘date -ls’

My bad, I forgot that the --backup-dir and the destinaton can’t overlap. You’ll have to use a separate directory or something like that for the backup dir.

With “–backup-dir remote:rclone_backup/date -ls” I get “Fatal error: unknown shorthand flag: ‘l’ in -ls`”

Any idea what the problem is? I’ve been trying for hours, thanks for your help.

That should be

–backup-dir remote:backup-`date -Is`

The date -Is will expand to something like 2018-09-24T16:15:52+01:00

That won’t work on Windows though, only on unix like OSes

1 Like


Any workaround idea for Windows in order not to overwrite already existing backuped files?

There are some ideas here: https://stackoverflow.com/questions/10945572/windows-batch-formatted-date-into-variable on how to get a date/time into an environment variable. Once you’ve got that it should be straight forward.

1 Like