I got a script to run daily at any time. So /etc/cron.daily
seems to be an easy solution.
But now I got the problem, the cronjob won't run that script. It seems like the cronjob won't run any of the daily jobs.
So I tried to put it to cron.hourly and everything worked fine. But I dont want to run the backup script every hour.
/etc/init.d/cron start|stop
works without errors.
/etc/crontab
looks like default:
m h dom mon dow user command
17 * * * * root cd / && run-parts --report /etc/cron.hourly
25 6 * * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily )
47 6 * * 7 root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.weekly )
52 6 1 * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.monthly )
As it won't run I tried to install anacron but without any changes.
Why does it run the hourly scripts but not the daily ones?
Many thanks to all of you!
It might be, that one of your daily-scripts is misbehaving. Try running them manually. I removed the logwatch package and the cron.daily job and it worked again.
This is my /etc/crontab
# /etc/crontab: system-wide crontab
SHELL=/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
# m h dom mon dow user command
16 * * * * root cd / && run-parts --report /etc/cron.hourly
12 2 * * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily )
41 1 * * 7 root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.weekly )
9 3 30 * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.monthly )
#
try running the daily like so
run-parts -v --report /etc/cron.daily
you can also use --list or --test for more output. In my case I removed the misbehaving script and the daily job worked again
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With