What's the best way to run simultaneous instances of the RClone move command?

Hi Folks,

My current script to move content from my seedbox to GDrive is as follows;

#!/bin/bash LOCKFILE="/var/lock/`basename $0`"

(
flock -n 9 || {
echo “$0 already running”
exit 1
}

/media/dma/craftyclown/bin/rclone moveto ~/private/rtorrent/data/Complete “gdrive:/The Skull/Complete” -v --min-age 1m --log-file=/media/dma/craftyclown/rclone-upload.log --tpslimit 6

) 9>$LOCKFILE

What would be more practical is to have separate transfers going from the multiple folders within Complete, eg Film, TV and music to the equivalent folders within GDrive. Would the following script be the right way to go about that?

#!/bin/bash
LOCKFILE="/var/lock/basename $0"

(
flock -n 9 || {
echo “$0 already running”
exit 1
}

/media/dma/craftyclown/bin/rclone moveto ~/private/rtorrent/data/Complete/Film “gdrive:/The Skull/Complete/Film” -v --min-age 1m --log-file=/media/dma/craftyclown/rclone-upload.log --tpslimit 6

/media/dma/craftyclown/bin/rclone moveto ~/private/rtorrent/data/Complete/TV “gdrive:/The Skull/Complete/TV” -v --min-age 1m --log-file=/media/dma/craftyclown/rclone-upload.log --tpslimit 6

/media/dma/craftyclown/bin/rclone moveto ~/private/rtorrent/data/Complete/Music “gdrive:/The Skull/Complete/Music” -v --min-age 1m --log-file=/media/dma/craftyclown/rclone-upload.log --tpslimit 6

) 9>$LOCKFILE

What’s the problem you are trying to solve?

I run 3 rclone moves in a single script as that works for me. I already have the majority of my library on my GD and rarely move more than 50-100 GB in a day so I have no fear of hitting the 750GB limit.

From glance, the script seems ok.

No problem per se. I was just wondering if I had my script set up correctly as I have never attempted to add multiple paths to the same script.
Would I be right in thinking they will all run simultaneously?

Think of each one of those as a command.

Each command would run before the next command would run the way that you have it setup.

I don’t think there is anything wrong with that as you normally want to keep thinks as simple as possible and unless you had a reason to run 3 at the same time, I think that’s fine.

Brilliant that’s what I was hoping it might be. Thanks for the help once again.

1 Like