Rclone copy: Save files as Google Drive File ID instead of File Name

Hello,

Does rclone support copying a file from Google Drive with the name being the id instead of the file name?

Thanks!

Not at the moment.

Why do you need that?

If you use the latest beta then you can use rclone lsf --csv --format pi to get a mapping of path names to IDs if that helps.

1 Like

Copying GDocs to PDFs in a specific target folder to Amazon S3, the S3 file URLs will then be referenced on sites. File names of said files could change by other people, so I would rather the URL be s3bucket/googlefileid.pdf to avoid the problem. I was messing around with the latest beta and using some powershell with lsf --format pi, that should suit my needs to match and rename first then copy to S3.

Thanks!

Wrote a quick PowerShell script to accomplish what I needed. Originally tried keys/values in a hashtable, but ran into an edge case when matching filenames with illegal NTFS characters. Rclone seems to use a similar but different character for (in this case /) when copying these to the local filesystem.

Here is the script if it helps anyone else: https://gist.github.com/bondurantdt/8afcb3a392500695bdc32ddc57d3881a

It does yes… It translates / into a similar looking unicode equivalent since you can’t have / in a file name on any OS whereas you can on google drive.

Glad you got it working!