David A. De Graaf | 1 Dec 2002 23:09
Favicon

Re: Printing next month's calendar

On Sun, Dec 01, 2002 at 03:27:07PM -0500, Brian Medley wrote:
> On Sun, Dec 01, 2002 at 01:52:29PM -0500, David A. De Graaf wrote:
> 
> > Something like
> >     rempr "now + 7d"
> > would be nice.
> 
> Not sure of the date format needed by rempr, but something similar to the
> following might do what you want:
> 
> 0 3 1 * *       /usr/local/bin/rempr `perl -MPOSIX -e 'print strftime "\%Y\-\%m\-\%d", \
> localtime(time + 7*86_400)'`

That is a very cool solution.  Thanks.
(Guess I really do need to learn perl, after all.)

Just one small edit to change the format because rempr needs: Jan 2003

0 3 22 * *      /usr/local/bin/rempr `perl -MPOSIX -e 'print strftime "\%b \%Y", localtime(time + 31*86_400)'`

By adding 31 days worth of seconds, I can run the command nearly any
day and get next month's calendar.

--

-- 
	David A. De Graaf    DATIX, Inc.    Hendersonville, NC
	dad@...    (828) 696-8646;  fax (828) 694-1037


Gmane