...

View Full Version : Cron Expression



daemonkin
05-29-2008, 10:49 AM
I have a script that is to run and 5pm on last day of month.

I have a little experience with CRON but came across the special character 'L' that can be used in day of month field.

Does the following look correct:
0 0 5 L * * [path to script]

D.

derzok
06-05-2008, 10:17 PM
By looking at http://www.linuxhelp.net/guides/cron/ I would say no. I think your digits might be off.
The format is:


1 Minute (0-59)
2 Hour (2-24)
3 Day of month (1-31)
4 Month (1-12, Jan, Feb, etc)
5 Day of week (0-6) 0 = Sunday, 1 = Monday etc or Sun, Mon, etc)
6 User that the command will run as
7 Command to execute


And if you have 0 0 5, that's saying 0th minute of 0th hour on the 5th day of the month.

Of course, I don't use cron a whole lot, so I could be wrong.

DaveR
06-05-2008, 10:52 PM
And if you have 0 0 5, that's saying 0th minute of 0th hour on the 5th day of the month.

Of course, I don't use cron a whole lot, so I could be wrong.

Nope you are not wrong (unless I am too!). I'm not familiar with using L to represent the last day of the month, but assuming it is correct you would need to do something like:

0 5 L * * * path/to/script



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum