[ale] crontab
Brandon Wood
woody at 2143.net
Thu Apr 23 13:56:41 EDT 2009
This doesn't address the specific question but it is related:
This seems like a good place to point out the following bit I keep in my
cron file. The comments that trace down to the columns has always been very
useful to me. I didn't come up with this and I'm sorry to say I don't
remember where I saw it first.
Also another thing I would suggest in terms of cron maintenance is editing
text file (I call mine cronjobs.txt) and when you want to update your cron
jobs you run: "contab -r && crontab ./cronjobs.txt" . crontab -r will clear
out your jobs and crontab ./file.txt will load your new jobs. It's been
handy to me have that setup for backups. YMMV
(word-wrap may be your enemy below)
==================
# Global variables
SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=woody at 2143.net
HOME=/home/bwood
# minute (0-59),
# | hour (0-23),
# | | day of the month (1-31),
# | | | month of the year (1-12),
# | | | | day of the week (0-6 with 0=Sunday).
# | | | | | commands
# | | | | | |
0 * * * * /home/bwood/script.sh
On Thu, Apr 23, 2009 at 5:42 PM, Pete Hardie <pete.hardie at gmail.com> wrote:
> On Thu, Apr 23, 2009 at 13:33, Chris Fowler <cfowler at outpostsentinel.com>
> 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.
>
> That looks like the only option - the only mention I found in GNU crontab
> was
> that day-of-month and day-of-week will BOTH be run if specified
>
>
>
> --
> Pete Hardie
> --------
> Better Living Through Bitmaps
>
> _______________________________________________
> Ale mailing list
> Ale at ale.org
> http://mail.ale.org/mailman/listinfo/ale
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.ale.org/pipermail/ale/attachments/20090423/9dfdddb0/attachment.html
More information about the Ale
mailing list