[lug] crontab range

Joseph Mills josephjamesmills at gmail.com
Tue Apr 7 16:53:44 MDT 2015


shortcut time .... make a script that uses date then if ....... make that
shit work for you,

Joseph

On Tue, Apr 7, 2015 at 4:23 PM, Dan Ferris <dan at usrsbin.com> wrote:

> */5 22,23,0 * * * ?
>
> On 04/07/2015 04:06 PM, Davide Del Vento wrote:
> > Is there a shortcut that allows my crontab to run every x minutes (say,
> > x=5) from 21:45 to 1:55 in a oneliner, without going to the verbose:
> >
> > # minute (0-59)
> > # |      hour (0-23)
> > # |      |      day of the month (1-31)
> > # |      |      |    month of the year (jan-dec)
> > # |      |      |    |     day of the week (sun-mon, with 0=sun)
> > # |      |      |    |     |        command
> > # |      |      |    |     |        |
> > #
> > 45-59/5 21      *    *     *        my-command
> > 0-59/5  22-23   *    *     *        my-command
> > 0-59/5  0       *    *     *        my-command
> > 0-55/5  1       *    *     *        my-command
> >
> > Or at least save some lines so I can be DRY in my-command? The following:
> >
> > 0-59/5  22-0   *    *     *        my-command
> >
> > is declared:
> >
> > "/tmp/crontab.6hXZFX":12: bad hour
> > errors in crontab file, can't install.
> >
> >
> >
> >
> >
> > _______________________________________________
> > Web Page:  http://lug.boulder.co.us
> > Mailing List: http://lists.lug.boulder.co.us/mailman/listinfo/lug
> > Join us on IRC: irc.hackingsociety.org port=6667 channel=#hackingsociety
> >
> _______________________________________________
> Web Page:  http://lug.boulder.co.us
> Mailing List: http://lists.lug.boulder.co.us/mailman/listinfo/lug
> Join us on IRC: irc.hackingsociety.org port=6667 channel=#hackingsociety
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lug.boulder.co.us/pipermail/lug/attachments/20150407/54ef1fa2/attachment.html>


More information about the LUG mailing list