|
|
|
|
||||||
| comp.unix.shell Using and programming the Unix shell. |
![]() |
|
|
LinkBack | Outils de la discussion |
|
|
#1 |
|
Messages: n/a
Hébergeur: |
Hey all... Before trying to reinvent wheels, does anyone have a script
to do more or less the following: logic: if [ today = 05/21/2007 ] then run this script (using at) incremented 30 days from now fi I don't need it to run on the 30th day of the month (s'what cron is for) just once in 30 days from the current date. (Thanks in advance before I forget)... |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
sil <dsphunxion@gmail.com> writes:
>Hey all... Before trying to reinvent wheels, does anyone have a script >to do more or less the following: >logic: >if [ today = 05/21/2007 ] > then > run this script (using at) incremented 30 days from now > fi >I don't need it to run on the 30th day of the month (s'what cron is >for) just once in 30 days from the current date. (Thanks in advance >before I forget)... % at now + 30 days at> echo And 30 days on at> <EOT> job 1182341860.a at Wed Jun 20 14:17:40 2007 Also possible things as "time + 30 days" (note that this will give you 30 days from the next occurence of time and if you schedule a job at noon every 30 days, you'd probably need to reschedule using "at noon + 29 days" though it appears to give some slack. (rounds down to whole minutes first) Casper -- Expressed in this posting are my opinions. They are in no way related to opinions held by my employer, Sun Microsystems. Statements on Sun products included here are not gospel and may be fiction rather than truth. |
|
|
|
#3 |
|
Messages: n/a
Hébergeur: |
A bit offtopic, but for people who need to manipulate dates from scripts,
I've written a bunch of std C and sh utilities a long time ago and use them regularly: http://www.gdargaud.net/Hack/SourceCode.html#StrfTime In particular it can compute dates in the future. -- Guillaume Dargaud http://www.gdargaud.net/ |
|
|
|
#4 |
|
Messages: n/a
Hébergeur: |
On May 21, 6:37 am, sil <dsphunx...@gmail.com> wrote:
> Hey all... Before trying to reinvent wheels, does anyone have a script > to do more or less the following: > > logic: > if [ today = 05/21/2007 ] > then > run this script (using at) incremented 30 days from now > fi > > I don't need it to run on the 30th day of the month (s'what cron is > for) just once in 30 days from the current date. (Thanks in advance > before I forget)... sil you might try "at -f script now + 43200 minutes" 43200 minutes is equal to 30 days. hth, CB |
|
|
|
#5 |
|
Messages: n/a
Hébergeur: |
In article <1179747472.952250.253170@n15g2000prd.googlegroups .com>,
sil <dsphunxion@gmail.com> wrote: >Hey all... Before trying to reinvent wheels, does anyone have a script >to do more or less the following: > >logic: >if [ today = 05/21/2007 ] > then > run this script (using at) incremented 30 days from now > fi > >I don't need it to run on the 30th day of the month (s'what cron is >for) just once in 30 days from the current date. (Thanks in advance >before I forget)... > Any of the following will work : 'at now + 2 fortnights + 2 days <furlong' 'at now + 4 weeks + 2 days <furlong' 'at now + 30 days <furlong' 'at now + 7200 hrs <furlong' |
|
![]() |
| Outils de la discussion | |
|
|