Rclone & windows task scheduler issues

What is the problem you are having with rclone?

When setting up rclone with windows task scheduler, I'd like to have the script run whether the user is logged in or not from my server. Currently, if i select "run only when user is logged on" the script runs fine and executes at the desired specs.
If I select "Run whether user is logged on or not" the script "doesn't run" - task scheduler claims the task is running, and it has a log for scheduler claiming the task runs, however nothing is actually happening with rclone. I do see in task manager that it is attempting to run...but it isn't executing anything in the script.

What is your rclone version (output from rclone version)

Version 1.55.1

Which OS you are using and how many bits (eg Windows 7, 64 bit)

Windows Server 2012 R2 64bit, Win 10 Pro 64bit (task issues are identical on both)

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 copy "redacted" "remote:redacted"
rclone sync "redacted" "remote:redacted"

The rclone config contents with secrets removed.

type = drive
scope = drive
token = {"access_token"}

A log from the command with the -vv flag

Not sure how to create a log my apologies

hello and welcome to the forum,

so you have a batch script, .bat or .cmd or are you hard coding the command inside task scheduler?

  • what is the username that the task runs as?

  • make sure to use full paths,
    c:\location\of\rclone\rclone.exe, not rclone.exe

  • hard code the location of the rclone file.

  • use a log file
    -log-level=DEBUG --log-file=c:\path\to\log\rclone.log

Thank you!

To answer your question, I have a VBS file (to hide the cmd window) and it is pointed to a .CMD script.

the username the task runs as is my domain admin account.

The paths look as follows in my script:
P:\batch\rclone\rclone.exe copy "\location\on\network\share\Account Managers" "remote:Account Managers"
This works without issues if I double click on the script (whether the VBS or the CMD portion) - only have issues with task scheduler running that script for some reason.

Let me look into hard coding the location & logging.
Question: Do I hard code the config into the script?

keep in mind that windows keeps two isolated sets of network shares per user,
one set of user without admin privileges and one set for user with admin privileges.

so make sure the script can see the source
as a test, add a command such as
dir \\location\on\network\share\Account Managers > list.txt
add a net use to the script

hard code the location of the rclone file.

Thank you. I did check, it was able to see

Volume in drive \\network\share has no label.
Volume Serial Number is redacted

As for the hard coding, would I do P:\batch\rclone\rclone.exe --config=C:\users\user\location\to\rclone.conf ?

to get the path run
rclone config file

I know my current path to the config file, but I'm having a hard time understanding how to hard code the path in.
When I attempt to add --config I get "usage" and "available commands" prompt.

add this to the rclone command
--config= and then the full path to the config file

"Error: unknown shorthand flag 'o' in -onfig=C:\path\specified\to\config\rclone.conf"

It seems to be omitting the letter C when I do this.

--config, not -config

Is it normal that after that command I get

  rclone [flags]
  rclone [command]

Available Commands:
  about           Get quota information from the remote.
  authorize       Remote authorization.
  backend         Run a backend specific command.
  cat             Concatenates any files and sends them to stdout.
  check           Checks the files in the source and destination match.
  cleanup         Clean up the remote if possible.
  config          Enter an interactive configuration session.
  copy            Copy files from source to dest, skipping already copied.
  copyto          Copy files from source to dest, skipping already copied.
  copyurl         Copy url content to dest.
  cryptcheck      Cryptcheck checks the integrity of a crypted remote.
  cryptdecode     Cryptdecode returns unencrypted file names.
  dedupe          Interactively find duplicate filenames and delete/rename them.
  delete          Remove the contents of path.
  deletefile      Remove a single file from remote.
  genautocomplete Output completion script for a given shell.
  gendocs         Output markdown docs for rclone to the directory supplied.
  hashsum         Produces a hashsum file for all the objects in the path.
  help            Show help for rclone commands, flags and backends.
  link            Generate public link to file/folder.
  listremotes     List all the remotes in the config file.
  ls              List the objects in the path with size and path.
  lsd             List all directories/containers/buckets in the path.
  lsf             List directories and objects in remote:path formatted for parsing.
  lsjson          List directories and objects in the path in JSON format.
  lsl             List the objects in path with modification time, size and path.
  md5sum          Produces an md5sum file for all the objects in the path.
  mkdir           Make the path if it doesn't already exist.
  mount           Mount the remote as file system on a mountpoint.
  move            Move files from source to dest.
  moveto          Move file or directory from source to dest.
  ncdu            Explore a remote with a text based user interface.
  obscure         Obscure password for use in the rclone config file.
  purge           Remove the path and all of its contents.
  rc              Run a command against a running rclone.
  rcat            Copies standard input to file on remote.
  rcd             Run rclone listening to remote control commands only.
  rmdir           Remove the path if empty.
  rmdirs          Remove empty directories under the path.
  serve           Serve a remote over a protocol.
  settier         Changes storage class/tier of objects in remote.
  sha1sum         Produces an sha1sum file for all the objects in the path.
  size            Prints the total size and number of objects in remote:path.
  sync            Make source and dest identical, modifying destination only.
  touch           Create new file or change file modification time.
  tree            List the contents of the remote in a tree like fashion.
  version         Show the version number.

Use "rclone [command] --help" for more information about a command.
Use "rclone help flags" for to see the global flags.
Use "rclone help backends" for a list of supported services.

The command I wrote:

 P:\batch\rclone\rclone.exe --config=C:\users\admingr\.config\rclone\rclone.conf

you left out the action you want rclone to do...

P:\batch\rclone\rclone.exe copy
P:\batch\rclone\rclone.exe sync

Oh! Duh its at the end of the parameters, my mistake. Ok I configured it but it still doesn't seem to run in task scheduler with the "logged in or not" box checked - even when I'm signed on.

as i pointed out, need to use a rclone debug log file...

best to test by not enabling logged in or not

make sure task scheduler is running the script.

I'm sorry I'm rather new to scripting as you can probably tell. I created a new task for it in task scheduler and deleted the old one and it actually worked this time with the "logged in or not" box checked! I think we might be in the money as they call it, I'm gonna log myself out and see if it still runs but it looks promising! Thank you for all your help so far.

EDIT: Thanks a ton @asdffdsa, the script works without issues now and everything is working logged in or not. I really appreciate your time and patience.

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