crontab problem

ron

Member
Hi. This is not a Progress question, but I am sure Progress DBAs would be able to throw light on this problem. It's a question about how crontab works in RH Linux.

I have a job that archives and purges audit data. It is very process-intensive and it was set to run several small slices of work each evening to spread it out in order to not interfere too much with other work. But it has been interfering (badly) so I wanted to run it over a weekend and not during the week at all. Therefore I set-up entries in the crontab like this:

30,50 19,20 3-31 * 6 /u2/xxx/auditArch LIMIT=80000 KEEP=9 >> /tmp/auditArch.err 2>&1
10 20,21 3-31 * 6 /u2/xxx/auditArch LIMIT=80000 KEEP=9 >> /tmp/auditArch.err 2>&1
30 5-7 3-31 * 0 /u2/xxx/auditArch LIMIT=120000 KEEP=9 >> /tmp/auditArch.err 2>&1

30 19-22 3-31 * 0 /u2/xxx/auditArch LIMIT=250000 KEEP=9 >> /tmp/auditArch.err 2>&1

To my surprise I found that cron was obeying the specification for hour / minute, but completely ignoring the "day-of-week". I expected that it would obey all the specifications. Is this a bug -- or is it supposed to work like that?

Ron.
 

jhenzenn

New Member
This is expected behavior, as per "man 5 crontab" command:

"Note: The day of a command's execution can be specified in the following two fields — 'day of month', and 'day of week'. If both fields are
restricted (i.e., do not contain the "*" character), the command will be run when either field matches the current time. For example,
"30 4 1,15 * 5" would cause a command to be run at 4:30 am on the 1st and 15th of each month, plus every Friday."
 
Top