Add suffix to all files copied

Hi, we use copy and move to transfer files to Azure Datalake or Sharepoint.
We want to add something in the suffix on the destination.
So for example, if there are files on the source location named:
File1.txt --> on destination: File1_ABCD.txt
File2.txt --> on destination: File2_ABCD.txt
File3.txt --> on destination: File3_ABCD.txt
...
we try to use --suffix ABCD and --suffix-keep-extension, which only works when files allready exist on the destination with the names:
File1.txt
File2.txt
File3.txt

But we want this for all the files, even if they don't exist on the destination.
Any suggestions? Is there a flag for this?

Kind regards,

Peter

Is there a flag for this?

There is not. I ran into the same thing when thinking about my rclone-based backup tool dfb which adds the upload date to all files--though it tries to do it before the extensions(s).

I ended up just scripting it. Originally with copyto statements but they were slow because it reauthorized each call. I eventually moved to using the rc API.

You could create a feature request. I can't imagine it is too hard for someone comfortable with both go and the rclone codebase (I am neither. I am a hobby Python developer).

If you're interested in trying something experimental, I made a proof-of-concept for a rclone convmv command that could help with this (by renaming the files at the destination). It has --replace and --suffix modes.

1 Like

Thanks, we will try this