Script works, but not when running using crontab

What is the problem you are having with rclone?

I have a script to keep my 2nd Server as a standby/hot backup for when my primary Nextcloud fails.
this script runs without any problem when launched as the root-user from command-line:
/usr/bin/backuptoSTANDBY
but it does nothing when it resides in the roots -crontab.
I have another crontab setup in there which works and I have a newline below my non-wokring rclone-script.

this is the crontab-line:

*/15 * * * * /usr/bin/backuptoStandby

this is the script:

rclone sync nameofmyConfig: /var/snap/nextcloud/common/nextcloud/data/ROOT/files/ --exclude Torrents/ --exclude USB/ && nextcloud.occ files:scan ROOT Administrator && nextcloud.occ files:cleanup

Run the command 'rclone version' and share the full output of the command.

rclone v1.50.2
os/arch: linux/arm64
go version: go1.13.8

Which cloud storage system are you using? (eg Google Drive)

Nextcloud (webdav)

That's an ancient version so wise to upgrade.

crontab's have no paths/environment set so you have to use a full path if that's your whole script so you want to replace rclone with the full path.

/usr/bin/rclone or whatever it is.

1 Like

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