I have a Linux gentoo system, which performs a cronjob every day at 3:10 in the morning. However, no file in /etc contains any related information to this particular cronjob, and the result of crontab -l is

# check scripts in cron.hourly, cron.daily, cron.weekly and cron.monthly
0  *  * * * rm -f /var/spool/cron/lastrun/cron.hourly
1  3  * * * rm -f /var/spool/cron/lastrun/cron.daily
15 4  * * 6 rm -f /var/spool/cron/lastrun/cron.weekly
30 5  1 * * rm -f /var/spool/cron/lastrun/cron.monthly
*/10 * * * * test -x /usr/sbin/run-crons && /usr/sbin/run-crons

The directory /etc/cron.daily probably contains the job in question, but for a time at 3:01! Why is that? Is the actual cronjobn stored somewhere else? Does it take gentoo 9 minutes to realize to execute a job?

Additional information:

  • I have a different crontab job for 13:20 (in cron.d) which is executed exactly at 13:20 every day.
  • no idea about gentoo, but maybe the job is run under another user context? Look into /var/spool/cron/ , maybe you find something there. Jun 13 '14 at 7:53
  • Did not find something different there; I am looged in to the system as root.
    – Alex
    Jun 13 '14 at 7:57

Check if it's not from another user:

getent passwd | while read r; do sudo -u $(echo $r | cut -d':' -f1) crontab -l; done
  • No there isn't another user which has a cronjob at 3:10. If crontabs are defined, they are identical to the one I posted above.
    – Alex
    Jun 13 '14 at 11:09

crontab -l only lists the per-user crontab of the calling user. There is also a system crontab, which can only be edited by root but can run jobs as any users. The system crontab is in the file /etc/crontab, with additional jobs in files in the directory /etc/cron.d.

The directories /etc/cron.daily, /etc/cron.weekly and /etc/cron.monthly are not built into by cron, but traversed by a job listed in /etc/crontab.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.