How to monitor rclone sync with windows task scheduler?

I am using rclone sync with windows task scheduler. What are the ways to get notified when sync was unsuccessful. I know about healthchecks.io but I don't know a way for it to work with task scheduler.

What approach do others take ?

hi,

there are a numnber of ways.
--- can check the exit code, if non-zero, then there was an error.
--- my backup scripts always sends an email when done.
the body of the email is short summary of rclone debug log. also, fastcopy, 7zip, restic
the attachement of the email is the full debug log, but redacted for id/secrets/etc.

froim the docs, can use a simple command such as
# Sends an HTTP GET request with curl: curl -m 10 --retry 5 https://hc-ping.com/your-uuid-here

have you searched the forum?
[This image provides a feature that allows me to set up a healthcheck.io URL to receive notifications for successful and failed copies.](Max-duration option is triggering exit with error)

https://forum.rclone.org/t/help-with-simple-script-copy-multiple-folder-and-exit-code/36716/7

https://forum.rclone.org/t/how-to-handle-non-error-errors/29564

this is a very simple, working example, .cmd script

this command will error out as the folder does not exit.
note: the exit-code from rclone is 3
note: i set the user-agent, as a convenience, to be displayed at their website

%rcmd% lsd c:\doesnotexit
@if  %ERRORLEVEL% NEQ 0 (
	echo Failed with exit-code = %errorlevel%
	curl --user-agent "DisplayThisText" --retry 3 https://hc-ping.com/uuid/%ERRORLEVEL%
)

here is the output from the command line.
notice that the exit-code = 3

rclone lsd c:\doesnotexit 
ERROR : : error listing: directory not found
Failed to lsd with 2 errors: last error was: directory not found
Failed with exit-code = 3
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100     2  100     2    0     0      5      0 --:--:-- --:--:-- --:--:--     5
OK

and from healthchecks.io website.
notice that the status = 3, same as the exit-code from rclone

How do you run it silently ?

I was running the rclone sync command directly from task scheduler, guess I'll use a script to check error code.

yes, can use my working example.

yes, that is the way to [quote="SidMan, post:4, topic:44533, full:true"]
How do you run it silently ?
[/quote]
much discussed in the forum...
there a number of ways, often i use nircmd, from nirsoft, perhaps the best set of free tool for windows.

for example,

start "rclone" rclone copy ....
waitfor /t 1 whatever
nircmd win hide title "rclone"
1 Like

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