PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Forums Hébergement > Forum Serveur - Sécurité et techniques > comp.unix.shell > Run in a 30 day increment from now
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
comp.unix.shell Using and programming the Unix shell.

Run in a 30 day increment from now

Réponse
 
LinkBack Outils de la discussion
Vieux 21/05/2007, 12h37   #1
sil
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Run in a 30 day increment from now

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)...

  Réponse avec citation
Vieux 21/05/2007, 13h20   #2
Casper H.S. Dik
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Run in a 30 day increment from now

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.
  Réponse avec citation
Vieux 22/05/2007, 10h59   #3
Guillaume Dargaud
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Run in a 30 day increment from now

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/


  Réponse avec citation
Vieux 22/05/2007, 16h32   #4
chris.l.bryant@gmail.com
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Run in a 30 day increment from now

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

  Réponse avec citation
Vieux 30/05/2007, 19h42   #5
Robert Bonomi
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Run in a 30 day increment from now

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'
  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 05h17.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,93128 seconds with 13 queries