What does this line mean in /etc/crontab file ?
59 * * * * root rm -f /var/spool/cron/lastrun/cron.hourly
What does this line mean in /etc/crontab file ?
59 * * * * root rm -f /var/spool/cron/lastrun/cron.hourly
59 * * * *
- Run every hour at minute :59, every day of month, every month and every day of week
root
- run as user root
rm -f /var/spool/cron/lastrun/cron.hourly
- execute this command
Here's a nice representation from a crontab example on CentOS 6:
# Example of job definition:
.---------------- minute (0 - 59)
| .------------- hour (0 - 23)
| | .---------- day of month (1 - 31)
| | | .------- month (1 - 12) OR jan,feb,mar,apr ...
| | | | .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat
| | | | |
* * * * * user-name command to be executed
I think this prevents to run every hour the cron jobs!
If you have a job that runs every hour from some user and you want to find the job just run :
for user in $(cut -f1 -d: /etc/passwd); do crontab -u $user -l; done
This command is to list all cron jobs from all users. In some cases you will find cron jobs here /etc/crontab but this is not a file for your cronjobs is only system-wide crontab