You are reading a single comment by @Greenbank and its replies. Click here to read the full conversation.
  • I've got a script for backing up my Rasperry Pi (not mine, I nicked it from somewhere, it looks very complicated).

    To run it I use

    sudo sh /home/pi/bkup_rpimage/bkup_rpimage.sh start -c /media/Raspi/Backup/$(date +%Y-%m-%d)_rpi_backup.img
    

    which works fine.

    I want to run it on a schedule though so trying to run it as a cron job.

    I did

    sudo crontab -e
    

    which so far as I understand is what you use for running jobs that need root and then my entry is

    0 1 1,15 * * sh /home/pi/bkup_rpimage/bkup_rpimage.sh start -c /media/Raspi/Backup/$(date +%Y-%m-%d)_rpi_backup.img
    

    which should run it twice a month.

    I can see from syslog that it has started but no backup is created. I do get an error message

    (CRON) info (No MTA installed, discarding output)
    

    but so far as I can tell from google this shouldn't be stopping it running.

    Any bright ideas? Cheers

  • I do get an error message

    (CRON) info (No MTA installed, discarding output)
    

    but so far as I can tell from google this shouldn't be stopping it running.

    That's CRON saying that it can't find anything to use to mail you the stdout/stderr that the script is producing.

    So you might be getting some errors but they'll never be reported anywhere.

    Changing the script being run to do something like:-

    sh /home/pi/bkup_rpimage/bkup_rpimage.sh start -c /media/Raspi/Backup/$(date +%Y-%m-%d)_rpi_backup.img > /tmp/backup.log.$(date +%s) 2>&1
    

    would mean the output gets redirected to a /tmp/backup.log.<UTC date> file which you can look at yourself.

About

Avatar for Greenbank @Greenbank started