Rclone copy single file but renamed

Is it possible to use rclone to copy a file but rename it on the destination?. my use case is I’ve been using filebot to rename the files and copy them to a rclone mounted folder. This works 99% of the time but it has been failing lately or timing out with ACD issues, I want to replace this function purly with using rclone. In my script I have all the variables defined; source file, renamed file and complete destination (sub folders etc…) but when I run rclone it ends up creating a directory as the file name.

example command:
rclone copy --stats 0 /home/user/files/ReleaseName/file.ext decrypted:/Category/renamedfile.ext

expected result when browsing ACD/Decrypted mount (I’ve tried --no-traverse as well use of quotes but same result)
/Category/renamedfile.ext

Actual result
/Category/renamedfile.ext/file.ext

1 Like

You want the newly made copyto command which you can find in the latest beta.

$ rclone help copyto
If source:path is a file or directory then it copies it to a file or
directory named dest:path.

This can be used to upload single files to other than their current
name.  If the source is a directory then it acts exactly like the copy
command.

So

    rclone copyto src dst

where src and dst are rclone paths, either remote:path or
/path/to/local or C:\windows\path\if\on\windows.

This will:

    if src is file
        copy it to dst, overwriting an existing file if it exists
    if src is directory
        copy it to dst, overwriting existing files if they exist
        see copy command for full details

This doesn't transfer unchanged files, testing by size and
modification time or MD5SUM.  It doesn't delete files from the
destination.

Usage:
  rclone copyto source:path dest:path [flags]

awesome! I’ll take a crack at it.

It seems to be uploading the file again, is this expected?

I would prefer a server side rename ( or move idk ). I used this command for example :slight_smile:

rclone copyto /var/lib/plexmediaserver/nonread/TvShows/Mr.Robot/Mr.Robot.S01E03.eps1.2.d3bug.mkv.1080p.WEB-DL.DD5.1.H.264-NTb.DUAL-por.srt crypt:TvShows/Mr.Robot/Mr.Robot.S01E03.eps1.2.d3bug.mkv.1080p.WEB-DL.DD5.1.H.264-NTb.DUAL.por.srt -v

To rename a .srt file and it just uploaded the same file with a different name. That’s not what I want. That would waste a lot of bandwidth if I’m working with big files