2

I recently upgrade to Ubuntu 15.04 and after that I get these strange errors in my cron e-mail. Sadly I didn't remember what version of ubuntu I was upgrading from but I think it was the latest before 15.04.

The rsync script called by backup_nas still works, it's just a simple bash script that calls rsync.

/etc/cron.daily/apt:
/etc/cron.daily/apt: 91: /etc/cron.daily/apt: date: not found
/etc/cron.daily/apt: 97: /etc/cron.daily/apt: rm: not found
/etc/cron.daily/apt: 448: /etc/cron.daily/apt: pidof: not found
/etc/cron.daily/apt: 176: /etc/cron.daily/apt: date: not found
/etc/cron.daily/apt: 176: /etc/cron.daily/apt: date: not found
/etc/cron.daily/backup_nas:
sending incremental file list

My /etc/crontab :

SHELL=/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin

My /etc/anacrontab:

SHELL=/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
HOME=/root
LOGNAME=root

# These replace cron's entries
1       5       cron.daily      run-parts --report /etc/cron.daily
7       10      cron.weekly     run-parts --report /etc/cron.weekly
@monthly        15      cron.monthly    run-parts --report /etc/cron.monthly

What could be the problem? I have done a apt-get dist-upgrade and it does not give me any errors. Also I tried to reinstall unattended-upgrade but that didn't change anything.

4
  • Does your /etc/crontab contain an appropriate PATH? if in doubt, please edit your question to include the contents of that file as well Jul 13, 2015 at 14:58
  • I have never changed anything there so I hop it's correct. Updated accordingly.
    – Sun_Blood
    Jul 13, 2015 at 17:58
  • Please edit your question and add the output of cat /etc/anacrontab
    – heemayl
    Jul 13, 2015 at 20:03
  • Sure. I have updated the post.
    – Sun_Blood
    Jul 13, 2015 at 20:35

1 Answer 1

0

Replace all instances of date with /usr/bin/date and do the same for every command/path.

Use absolute paths in cron scripts, expect the shell to be dumb and not use any PATH or environmental variables. Also the shell used by default is /bin/sh not bash.

date: not found

which date
/usr/bin/date

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .