Rclone sync with command "For"

To back up my remote computer i use the next commands
rclone sync ex1:data ex1:backup --max-transfer 700G;rclone sync ex2:data ex2:backup --max-transfer 700G;rclone sync ex3:data ex3:backup --max-transfer 700G; etc
When the command has error (limit, without line, etc) i can kill the loop with ctrl+z and jump the next loop. Example ex1 to ex1 (error) ctrl +z, jump to next command ex2 to ext2
I try with this loop "For"
for i in {1..5}
echo "account $i "
rclone sync ex"$i":data ex"$i":backup --max-transfer 700G

With this command i have 2 problems
If I kill with ctrl +z i kill all for and stop all the process
Can I make it go if error rclone jump to the next loop?
If i can't, Is there a key to kill just one loop?

Why do you need to stop the process though? rclone should come to a natural termination once it reaches the max limit - and the script should proceed then. I just don't see why a CTRL-z is needed. (is ctrl-z different from ctrl-c?)

But in general if you needed to break just the loop you are inside of then a "break" command is what is typically used to achieve this. You'd have to look up what the syntax is for that in bash, but I'm sure there is an equivalent to that function. That's not a key though (not the break key) but a programmable command - just so I don't confuse you :slight_smile:

"natural termination once it reaches the max limit" its no the problem. This work fine
The problem is when rclone reach the limit api or its loose the conection (1 second) and the process are stuck

Ah, I see.
Well, rclone stalling out if hitting a max-quota is a yet-unsolved problem I am afraid. Although I have some ideas that might work there is unfortunately no real "clean" way of doing it because 403 errors can also just mean you temporarily hit the API limit (which is perfectly normal and will happen in regular operation).

So that's why you want a way to close rclone without breaking the whole script.
I do not know the solution to that unfortunately :confused:

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