Single code (cronjob) to copy some folders to remote and others remote crypt

What is the problem you are having with rclone?

So Rclone is working really well right now, if i do copies one by one. I use a Synology NAS to copy my files from the NAS to Jottacloud.

I set it up with 2 remotes. "remote:" is unencrypted. and "remote_encrypted" is, well, encrypted.

I tried using the Task Scheduler and just add them one by one, so:

         #!/bin/bash

        rclone copy "/volume1/unencypted 1" remote:"unencrypt 1"
        rclone copy "/volume1/unencypted 2" remote:"unencrypt 2"
        rclone copy "/volume1/unencypted 3" remote:"unencrypt 3"
        rclone copy "/volume1/encypted A" remote_encrypted:"encrypted A"
        rclone copy "/volume1/encypted B" remote_encrypted:"encrypted B"

But that doesn't work. Probably (i assume) because it's just trying to run all 5 items at the same time, which isn't allowed.

I read that you can combine them using --include. But i want one part encrypted, and the other not. So i'll still have the same issue.

Is there a way to make it "wait" for the first line to be complete, and THEN move to the next one?

PS: for the rest, great software. I was afraid first because it's all code and stuff. But it's really easy once you get it installed and figure out how to SSH.

hello and welcome to the forum,

when you posted, you were asked for information, to answer your question, we need that info.

if you run a cron job and the job runs as a different username then you are, then rclone might not be able to find the config file, so you might want to use --config
but until you post a debug log, cannot be sure that is the problem.

batch files run one line at a time,
the first rclone copy has to finish before the script will run the second rclone copy and so on


i could be wrong but these two

rclone copy "/volume1/encypted A" remote_encrypted:"encrypted A"
rclone copy "/volume1/encypted B" remote_encrypted:"encrypted B"

can be combined into

rclone copy /volume1 remote_encrypted: --include="encrypted {A,B}"

That should be --include="/encrypted {A,B}/**" but yes, right idea

I tried to fill in all info. But i did not have access to the SSH at the time of asking, so i couldn't add the version or log. I should have waited before asking the question.

When running from Task logs are not enabled by default so didn't have a log yet.

But i think i see my issue.
I had:
#!bin/ash
changed to
#!bin/bash

And now it seems to work fine according to the logs that i've enabled. I always thought it was a comment because of the # and wasn't actually used. But i was wrong it seems.
And i thought it didn't wait for the previous action to be finished. But that too was wrong. I learned a lot today.

I'll see if i can combine it. thanks for the help!

1 Like

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