Upload local symlink as Google Drive Shortcuts

I have this example directory structure:

  • root_folder/
    • original/
      • file1
      • file2
      • file3
    • sorted/
      • property_a/
        • (symlink) descriptivenameof_file1
      • property_b/
        • (symlink) descriptivenameof_file2
        • (symlink) descriptivenameof_file3

In this case, I'm uploading root_folder to Google Drive.

I want to share the "sorted" folder with people, while retaining the original as a raw backup (kinda) of the files. Currently, when I upload this using rclone, I use the --copy-links, which uploads the original files in place of the symlink.

This works perfectly, except it takes up twice the storage space and upload time. I read the documentation and it seems like Google Drive shortcuts can be manually created using rclone backend and can be dereferenced when downloading, but I didn't see anything about uploading. Is there any way to convert these local symlinks to Google Drive shortcuts using rclone?

I think you'd have to do a bit of scripting. So ignore links in your original upload then find the links and create shortcuts with rclone backend shortcut drive:

Note that google shortcuts don't have quite the same semantics as symlinks - they are more like hardlinks as they link direct to the underlying object rather than to the place in the directory tree. This means you can move the destination of a google shortcut and the shortcut will keep working (unlike a symlink). This also means that the concept of symlinks and shortcuts aren't directly interchangeable so I'm not sure syncing them would be possible easily (for example the destination has to exist for a shortcut whereas it doesn't for a symlink).

1 Like

Got it, thanks. I'll see if I can make something that fits my use case and will share it here if it works.

1 Like

I'm now using a real EDMS-like solution instead of sorting things on Google Drive, so I didn't make the script. (just in case anyone looking to do the same finds this thread in the future)

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