Jaymon / stockton

Quickly setup an email server to forward a personal domain to any email address
Other
4 stars 0 forks source link

Maybe this fixed the cron problems #29

Closed Jaymon closed 8 years ago

Jaymon commented 8 years ago

I've been receiving this email

Cron <**********@*************> test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily )

/etc/cron.daily/apt:
FATAL -> Failed to fork.

Every night at midnight, after doing some digging I ran this command:

$ sa-update --refreshmirrors

And I didn't receive the email tonight, if I don't receive the email again in the next few days I'll add this to the spam assassin configuration.

Jaymon commented 8 years ago

Eh, here is what I finally did to get rid of that email (from my notes):

Handling cronjob error emails

If you get an email with the subject:

Cron <root@marcyes> test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily )

and the body:

/etc/cron.daily/apt:
FATAL -> Failed to fork.

You can turn it off by adding:

> /dev/null 2>&1

To all of the commands in /etc/crontab.

So, you can edit the file:

$ sudo vi /etc/crontab

and then make all the lines for daily, weekly, and monthly, look like this:

25 6    * * *   root    test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily > /dev/null 2>&1 )

That should get rid of the email. Not sure if this is worth automating since it only becomes a problem on the box that hosts my email.