![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| UNIX for Advanced & Expert Users Advanced UNIX and Linux questions go here. Expert-to-Expert. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| cron job starts new cron proccess | ron76 | SUN Solaris | 3 | 05-11-2008 10:07 PM |
| Cron and Pseudo-Cron | dingusmcghee | UNIX for Dummies Questions & Answers | 1 | 01-31-2008 08:58 AM |
| CRON usage for CRON job | skyineyes | UNIX for Dummies Questions & Answers | 1 | 01-17-2008 06:17 AM |
| AIX and cron logs filtering ?: /etc/cronlog.conf, /var/adm/cron/log | Keith Johnson | AIX | 0 | 01-09-2008 04:32 PM |
| Cron : you are not authorized to use cron. Sorry. | tt155 | UNIX for Advanced & Expert Users | 1 | 07-06-2005 07:37 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
|||
|
Can cron run a script on the 4th Saturday of the month, every month? I don't believe it can.
Here's what I have so far: 30 5 24-31 * 6 <command> |
| Forum Sponsor | ||
|
|
|
|||
|
I did as you suggested but get this error:
sh: test: 0403-021 A ] character is missing. Here is my syntax (modified for testing today): 57 13 * * 4 [ `date +%e` -gt 8 -a `date +%e` -lt 11 ] && mail -s "cron test" me@homer.com < /users/me/test.txt Any ideas? |
|
||||
|
I have actually put code in a crontab and I too am getting the same error. That is odd since we have some very similiar tests in working crontabs. I don't have time to dig into now, but I will soon. In the meantime you could write a script called week4 that returns 0 or 1 depend on the week. And then use
week4 && command This has actually exposed a very interesting problem. Right now I'm thinking that cron jobs are pumped through a proto file just like at jobs. |
|
||||
|
There seem to be two issues: first everything after a per cent sign is getting truncated. You would think that I would have encountered a cron command before that used a %, but I guess that this must be my first. Also the backtick expressions are not being evaluated.
The syntax that works for me is: * * * * * eval [ `date +\%e` -gt 8 -a `date +\%` -lt 11] && <command> This is ugly enough that some cool script is needed. I'll write one this weekend. |
|
||||
|
Excuse my continuing monologue
Anything after a % is stripped off a cron command and is feed as standard input into the command. This is mentioned on crontab(1) manpage. SunOS even has an example on their manpage. |