Rclone task scheduler error (0x1)

What is the problem you are having with rclone?

I am trying to run my rclone script through task scheduler, but I keep getting 0x1 errors. The script works when run manually, but never works when run through task scheduler.

What is your rclone version (output from rclone version)

1.v56.1

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)

This is the output of the .bat file which is being run:

cd "C:\Program Files\rclone-v1.56.1-windows-amd64"
rclone sync "C:\Program Files (x86)\CatTools3\TFTP" Network:SwitchBackups
rclone sync "C:\FTP" Network:ConfigBackups
rclone delete C:\FTP\A10 --min-age 30d
rclone delete C:\FTP\Infoblox --min-age 30d
rclone delete C:\FTP\Ruckus --min-age 30d
rclone delete Network:ConfigBackups\A10 --min-age 14d
rclone delete Network:ConfigBackups\Infoblox --min-age 14d
rclone delete Network:ConfigBackups\Ruckus --min-age 14d
exit

as for task scheduler, I have run with highest privileges set. configure for is set for Server 2012 R2 (which is what the server is). Run whether user is logged on or not is selected. When I run the task manually through task scheduler (or if its run as a scheduled task) it immediately fails and gives me a "last run result" of (0x1). When run manually as a batch file, it works great.

I've tried so many different things at this point to try and get this to work but i'm at a point where I have no idea what else to try! I can get batch files to work fine without rclone commands in it, but whenever it needs to run anything through rclone I get these errors and the script doesn't run.

The rclone config contents with secrets removed.

I'm not sure what this means

A log from the command with the -vv flag

I don't think task scheduler is even running the thing. The script runs fine when run manually.

hello and welcome to the forum,

  • make sure all the file/directory paths are correct
  • for testing, start with something simple like.
   cd "C:\Program Files\rclone-v1.56.1-windows-amd64"
   rclone version --log-level=DEBUG --log-file=c:\path\to\folder\log.txt

make sure that log file exists and has correct output.

  • run the task as same user are you are logged in as.

That ran successfully with the following log file output:

2021/11/01 17:19:16 DEBUG : rclone: Version "v1.56.1" starting with parameters ["rclone" "version" "--log-level=DEBUG" "--log-file=C:\Program Files\rclone-v1.56.1-windows-amd64\log.txt"]
2021/11/01 17:19:16 DEBUG : rclone: Version "v1.56.1" finishing with parameters ["rclone" "version" "--log-level=DEBUG" "--log-file=C:\Program Files\rclone-v1.56.1-windows-amd64\log.txt"]

I added rclone version --log-level=DEBUG --log-file="C:\Program Files\rclone-v1.56.1-windows-amd64\log.txt" to the top of my batch file to see if the batch file would run with this line. I still got the same error 0x1 through task scheduler but it did seem that this debug line worked so task scheduler is at least running the script, just not the sync commands.

good, tasksch is running the script.
so there is something wrong with your batch fie.

try this

cd "C:\Program Files\rclone-v1.56.1-windows-amd64"
del rclone.log
rclone lsd Network: --dry-run --log-level=DEBUG --log-file=rclone.log

and post the output of rclone.log

Thanks! Sorry for the late response, I was able to use the output of this log to figure out and resolve the issue!

2021/11/02 10:16:58 DEBUG : rclone: Version "v1.56.1" starting with parameters ["rclone" "lsd" "Network:" "--dry-run" "--log-level=DEBUG" "--log-file=rclone.log"]
2021/11/02 10:16:58 DEBUG : Creating backend with remote "Network:"
2021/11/02 10:16:58 NOTICE: Config file "C:\Users\svcnetwork\AppData\Roaming\rclone\rclone.conf" not found - using defaults
2021/11/02 10:16:58 Failed to create file system for "Network:": didn't find section in config file

It seems that the service account I was using for task scheduler needed the rclone.conf file in its user directory. I copied it over from my account over to the service accounts directory and everything now works!

Thanks so much for your help!

good, that was what i was expecting to happen

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