Is there any way to create the shortcuts in batch

What is the problem you are having with rclone?

I wonder if there is any way to create the shortcuts in batch...
I need to create shortcuts from several files to another folder, but I could only do it by running the command file by file
rclone backend shortcut drive: FOLDER1/1.txt FOLDER2/1.txt
rclone backend shortcut drive: FOLDER1/2.txt FOLDER2/2.txt
rclone backend shortcut drive: FOLDER1/3.txt FOLDER2/3.txt

I did a workaround to get it done in batch but it is not the best method...
I used rclone lsf -F to list the folders with the following command

for f in $(rclone lsf -R drive:FOLDER1); do rclone backend shortcut drive: FOLDER1/"$f" FOLDER2/"$f"; done

the command is not 100% correct, I just put it to exemplify
it would be cool if there was a way to do something like... rclone backend shortcut drive:FOLDER1/* FOLDER2/
in my case I would like to have the shortcut to each file

Run the command 'rclone version' and share the full output of the command.

rclone v1.58.1

  • os/version: debian 11.3 (64 bit)
  • os/kernel: 5.10.0-14-amd64 (x86_64)
  • os/type: linux
  • os/arch: amd64
  • go/version: go1.17.9
  • go/linking: static
  • go/tags: none

Which cloud storage system are you using? (eg Google Drive)

Google Drive

The command you were trying to run (eg rclone copy /tmp remote:tmp)

rclone backend shortcut drive: test1/1.txt test2/1.txt

The rclone config contents with secrets removed.


A log from the command with the -vv flag


That batch script looks almost correct to me other than not dealing with spaces in filenames properly - try this

rclone lsf -R drive:FOLDER1 | while read -r f; do rclone backend shortcut drive: FOLDER1/"$f" FOLDER2/"$f" ; done
1 Like

Interesting, I will test it later. Thanks
another tip I noticed is to use --files-only to prevent it from creating the folders as shortcuts before the files and breaking the script

1 Like

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