[ale] crontab

Jeff Lightner jlightner at water.com
Thu Apr 23 14:01:19 EDT 2009


Not sure that would work:

>From crontab man page (on HP-UX):

Note that the specification of days can be made in two fields: monthday and weekday.
      If both are specified in an entry, they are cumulative.  For example,

           0   0   1,15   *   1   command

      runs command at midnight on the first and fifteenth of each month, as
      well as every Monday.

>From crontab (Vixie cron) man page (5) on RHEL5:

Note: The day of a commandâs execution can be specified by two fields        day of month, and day of week.  If  both  fields  are  restricted  (ie,       aren't  *),  the command will be run when either field matches the cur       rent 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.

Both man pages seem to suggest your example would run on the 1st, 2nd, 3rd, 4th, 5th, 6th, 7th AND every Thursday.  

-----Original Message-----
From: ale-bounces at ale.org [mailto:ale-bounces at ale.org] On Behalf Of JK
Sent: Thursday, April 23, 2009 1:40 PM
To: Atlanta Linux Enthusiasts - Yes! We run Linux!
Subject: Re: [ale] crontab

This crontab line should do it:

  # Min Hour Date Month  DoW  Cmd
    0   0    1-7  1-12   Thu  myCommand

It says, run every month on Thursdays, but only during the first
seven days of the month. There's only one Thursday per month that
matches all those criteria. (I may have the order of fields mixed
up.)

-- Joe


Chris Fowler wrote:
> I want to execute a script at 6pm on the first Thursday of each month.
> Is there a trick in crontab I can do?
> 
> Here are the fields allowed
> 
>               field          allowed values
>               -----          --------------
>               minute         0-59
>               hour           0-23
>               day of month   1-31
>               month          1-12 (or names, see below)
>               day of week    0-7 (0 or 7 is Sun, or use names)
> 
> The only thing I can think of off the top of my head is to run it every
> Thursday and then check to see if we are the first Thursday of the
> month. If not, exit 0.
> 
> 
> 
> 
> 
> _______________________________________________
> Ale mailing list
> Ale at ale.org
> http://mail.ale.org/mailman/listinfo/ale
> 
> 


-- 
A closed mouth gathers no feet.
_______________________________________________
Ale mailing list
Ale at ale.org
http://mail.ale.org/mailman/listinfo/ale
 
Please consider our environment before printing this e-mail or attachments.
----------------------------------
CONFIDENTIALITY NOTICE: This e-mail may contain privileged or confidential information and is for the sole use of the intended recipient(s). If you are not the intended recipient, any disclosure, copying, distribution, or use of the contents of this information is prohibited and may be unlawful. If you have received this electronic transmission in error, please reply immediately to the sender that you have received the message in error, and delete it. Thank you.
----------------------------------



More information about the Ale mailing list