Jean-David Beyer
2013-03-29 12:06:27 UTC
I am running Red Hat Enterprise Linux Server release 6.4 (Santiago).
In the past I was running RHEL 5, I filled in file /etc/crontab with
what I wanted to run and when I wanted to run it. For example, I had the
following entries in it
M H D m d user program arguments
01 * * * * root run-parts /etc/cron.hourly
04 1 * * 1-6 root run-parts /etc/cron.daily
04 3 * * 0 root run-parts /etc/cron.weekly
19 4 1 * * root run-parts /etc/cron.monthly
The last line would cause things to run the first day of each month at
04:19 in the morning.
With RHEL6, they do things differently and files in /var/spool/anacron
handle _when_ things are run.
For example, cron.monthly contains
20130329
It last ran March 1, and it tried to run today.
It runs a backup script to do a full backup to tape, but there was no
tape in the drive, so it failed.
I expected it to run April 1.
The cron.daily runs things every day, and the cron.weekly runs things
every week on Monday as I wish
How should I make /var/spool/anacron/cron.monthly run things on the
first of the month? Or, if that is the wrong question, how should I have
the cron system run my backup job on the first of the month? I suppose
if I put the right line in /etc/crontab it would work, but I am not
sure. Right now /etc/crontab is like this:
# cat /etc/crontab
SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
HOME=/
# For details see man 4 crontabs
# 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.e, it is essentially empty. I do not want to merely get it to work; I
want to do it using the current philosophy, but I do not understand the
current philosophy.
In the past I was running RHEL 5, I filled in file /etc/crontab with
what I wanted to run and when I wanted to run it. For example, I had the
following entries in it
M H D m d user program arguments
01 * * * * root run-parts /etc/cron.hourly
04 1 * * 1-6 root run-parts /etc/cron.daily
04 3 * * 0 root run-parts /etc/cron.weekly
19 4 1 * * root run-parts /etc/cron.monthly
The last line would cause things to run the first day of each month at
04:19 in the morning.
With RHEL6, they do things differently and files in /var/spool/anacron
handle _when_ things are run.
For example, cron.monthly contains
20130329
It last ran March 1, and it tried to run today.
It runs a backup script to do a full backup to tape, but there was no
tape in the drive, so it failed.
I expected it to run April 1.
The cron.daily runs things every day, and the cron.weekly runs things
every week on Monday as I wish
How should I make /var/spool/anacron/cron.monthly run things on the
first of the month? Or, if that is the wrong question, how should I have
the cron system run my backup job on the first of the month? I suppose
if I put the right line in /etc/crontab it would work, but I am not
sure. Right now /etc/crontab is like this:
# cat /etc/crontab
SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
HOME=/
# For details see man 4 crontabs
# 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.e, it is essentially empty. I do not want to merely get it to work; I
want to do it using the current philosophy, but I do not understand the
current philosophy.