Crontab to automatically run the same rclone sync... problems?

I want to keep sync data from my linux server to B2 daily. However, I don't want to enter the rclone sync command through terminal everyday. What happen if I set a Crontab with the same rclone sync command because both can run together?.

Any command you can run from the command line, you can schedule in cron so there is no issue with scheduling or using cron to run rclone.

I run a daily job to upload things via cron and works great.

In general, it would be wise to run not multiple sync commands at the same time though as it's better to run one than the other.

You can use timeout or --max-duration (I've had more predictable results with timeout).

0 0 * * * timeout 12h rclone blah blah

Runs rclone once a day for a maximum of 12 hours before terminating.

To avoid confusion by running multiple syncs just run a script instead of the command from cron and test whether already running. Maybe test something like:-

PGREP_USER=$(pgrep −u user rclone)
if [ −z $PGREP_USER ]
.... rclone sync command here...
..... notify there is an issue to log or mail here

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