0

I have the following script that I'm trying to run daily: $ cat /etc/cron.daily/my_backup_script

#!/bin/sh
pg_dump -h x.x.x.x -U myuser -d mydb -f /home/ubuntu/my_backup_dir/$(date '+%Y-%m-%dT%H-%M-%S').sql

This works as expected if I run run-parts -v --report /etc/cron.daily and the backup file is produced. However, it is not run daily as expected. In syslog I see apparent errors like the following:

/var/log/syslog:Jan  7 07:35:32 myhostname anacron[47699]: Job `cron.daily' terminated (exit status: 1) (mailing output)
/var/log/syslog:Jan  7 07:35:32 myhostname anacron[47699]: Can't find sendmail at /usr/sbin/sendmail, not mailing output
/var/log/syslog:Jan  7 07:35:32 myhostname anacron[47699]: anacron: Can't find sendmail at /usr/sbin/sendmail, not mailing output
/var/log/syslog:Jan  7 07:35:32 myhostname anacron[47699]: Normal exit (1 job run)
/var/log/syslog:Jan  7 10:37:03 myhostname anacron[17895]: Can't open timestamp file for job cron.daily: Permission denied
/var/log/syslog:Jan  7 10:37:03 myhostname anacron[17895]: Aborted
/var/log/syslog:Jan  7 10:43:35 myhostname anacron[18266]: Can't open timestamp file for job cron.daily: Permission denied
/var/log/syslog:Jan  7 10:43:35 myhostname anacron[18266]: Aborted
/var/log/syslog:Jan  7 11:14:43 myhostname anacron[21033]: Anacron 2.3 started on 2019-01-07
/var/log/syslog:Jan  7 11:14:43 myhostname anacron[21033]: Can't open timestamp file for job cron.daily: Permission denied
/var/log/syslog:Jan  7 11:14:43 myhostname anacron[21033]: Aborted

Any ideas what the problem could be, or at least how I can get more useful error output?

  • I would install a mailer, and then wait for the email to come in. – Michael Hampton Jan 7 at 20:03

Your Answer

By clicking "Post Your Answer", you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.