Cron job not running
Posted: Wed Apr 11, 2018 8:43 am
I have searched this forum and tried many solutions but I just can't get it to work.
I have a script here /home/admin/web/mydomain/public_html/rclone-cron.sh as below to use rclone to backup to Backblaze
If I run from a terminal (logged in as admin) the backup runs no problem.
Howver I cannot get it to run in cron, command as below,
I have checked the cron log in /var/log and find the lines,
But no backup perfomed, only when I run the command from a terminal does the backup run.
Any ideas?
I have a script here /home/admin/web/mydomain/public_html/rclone-cron.sh as below to use rclone to backup to Backblaze
Code: Select all
#!/bin/bash
if pidof -o %PPID -x "rclone-cron.sh"; then
exit 1
fi
rclone sync /home/admin/web/mydomain/public_html/ remote:bucket
exit
Code: Select all
/home/admin/web/mydomain/public_html/rclone-cron.sh
Howver I cannot get it to run in cron, command as below,
Code: Select all
sudo /home/admin/web/mydomain/public_html/rclone-cron.sh
Code: Select all
Apr 11 06:00:01 vultr CROND[6886]: (admin) CMD (sudo /home/admin/web/mydomain/public_html/rclone-cron.sh
Any ideas?