View Single Post

   
  #7 (permalink)  
Old 04-18-2008, 08:30 AM
Frank Slootweg
 
Posts: n/a
Default Re: how to start script in 30 seconds

mmccaws2 <mmccaws@comcast.net> wrote:
> On Apr 17, 1:37 pm, Frank Slootweg <t...@ddress.is.invalid> wrote:
> > mmccaws2 <mmcc...@comcast.net> wrote:
> > > On Apr 17, 12:37 pm, Michael Tosch
> > > <eed...@NO.eed.SPAM.ericsson.PLS.se> wrote:
> > > > mmccaws2 wrote:
> > > > > I guess my users are impatient. I'm trying to use a script that uses
> > > > > the 'at' command to start scripts. I use
> > > > > at now + 1 minutes
> > > > > ./startscripts
> > > > > ctrld

> >
> > > > > now but when I replace 1 minutes with 0.5 minutes or 30 seconds I get
> > > > > a bad date specification.

> >
> > > > > What the alternative?

> >
> > > > > Mike

> >
> > > > sleep 30 && ./startscripts &

> >
> > > > --
> > > > Michael Tosch @ hp : com

> >
> > > Oh but I won't be able to log off.

> >
> > nohup(1)

>
> so there is no way to use the 'at now +' command options? maybe I can
> query the time add thirty seconds then initiate the at command.


If you're really doing it the way you're saying, you can just do:

at now
sleep 30
../startscripts
ctrld

But you said "I'm trying to use a script that uses the 'at' command to
start scripts.". If you really are using a *script* that uses the 'at'
command, then you will have to insert the "sleep 30" either in the
invoking script or the invoked script. However your example is not a
script, but commands entered at the command line (in a script you can't
have commands after the "at" command and you can't have a ctrld (well
you can do *similar* things, but not those exact things)).

BTW, IIRC "at now", i.e. without '+ ...' can sometimes give problems
because the imaginary time 'now' has already passed when at(1) actually
executes. IIRC, the at(1) manual page has another command which is
essentially a "at now" but without the mentioned problem. IIRC, that
other command is 'batch'.
Reply With Quote