dolorosus / RaspiBackup

Backup your raspi
GNU General Public License v3.0
13 stars 4 forks source link

crontab item doesn’t start #15

Closed Vannixxo closed 2 years ago

Vannixxo commented 2 years ago

Hello, I always used this great script and restored my Rpi three times with it.

I never managed to get crontab working tough…

sudo bash /home/pi/RaspiBackup/RaspiBackup.sh start -i /dev/sdb -s 15000 -c /media/pi/Time\ Capsule/RaspiBackup/RaspiBackup$(date +%d-%m-%Y).img

this command works successfully when manually executed, but crontab never execs it (I even tried to run it each half an hour, nothing happens)

dolorosus commented 2 years ago

That's not an isssue of RaspiBackup.sh ...

  1. I would suggest to enter your backup command into root's crontab, so no sudo is needed.
  2. The command is executed by crontab with a minimal environment. it may be necessary to set additional environment variables or to specify paths explicitly.
  3. Is the crontab entry correct? Make yourself root sudo -i post the output of crontab -l

Without your cronjobs output (e.g. in /var/log/syslog) no further help is possible.

If you don't want to fiddle about crontab format, you should also have a look to anacron (which is installed in your Raspi by default). Write a small script which setup the env and starts the backup (the name of the script should have no extension). Put this script into one of anacrons folders (/etc/cron.hourly, /etc/cron.daily, /etc/cron.monthly).