FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian User

 
 
LinkBack Thread Tools
 
Old 03-13-2012, 01:28 AM
T o n g
 
Default : Cron, > 1 month but < 2 months

On Fri, 09 Mar 2012 12:37:19 +0100, Florian Ernst wrote:

>> >> Is there any easy way to schedule a job for a duration that is
>> >> greater than one month but shorter than 2 months? Any duration will
>> >> do, as long as it is easy to schedule.
>> >
>> > Easy? Hmmm.
>> >
>> > 0 12 * * 1 [ $(expr $(/bin/date +\%s) / 60 / 60 / 24 / 7 \% 8) -eq 3
>> > ] && myscript
>>
>> Nice.
>
> Oops, forgot to paste the trailing ... || /bin/true which keeps newer
> cron from reporting the job as failed whenever [ ... ] doesn't exit
> successfully.

Comparing to other posted answers, this is simply the easy way to
schedule.

I'll go with every 6 weeks (~45 days), or heck, go with every 7 weeks
because the script won't care if a year can be devided up in 7 weeks
nicely.

0 12 * * 1 [ $(expr $(/bin/date +\%s) / 60 / 60 / 24 / 7 \% 7) -eq 3
>> > ] && myscript || /bin/true

Thanks Florian.


--
Tong (remove underscore(s) to reply)
http://xpt.sourceforge.net/techdocs/
http://xpt.sourceforge.net/tools/


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: jjmbbo$hsc$1@dough.gmane.org">http://lists.debian.org/jjmbbo$hsc$1@dough.gmane.org
 

Thread Tools




All times are GMT. The time now is 03:28 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org