Unix Technical Forum

SEO

vBulletin Search Engine Optimization


Go Back   Unix Technical Forum > Unix Operating Systems > HP-UX Operating System

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-17-2008, 05:23 PM
mmccaws2
 
Posts: n/a
Default how to start script in 30 seconds

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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-18-2008, 08:30 AM
Michael Tosch
 
Posts: n/a
Default Re: how to start script in 30 seconds

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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-18-2008, 08:30 AM
mmccaws2
 
Posts: n/a
Default Re: how to start script in 30 seconds

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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (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, 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)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 04-18-2008, 08:30 AM
mmccaws2
 
Posts: n/a
Default Re: how to start script in 30 seconds

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.

Mike
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 04-18-2008, 08:30 AM
mmccaws2
 
Posts: n/a
Default Re: how to start script in 30 seconds

On Apr 17, 1:46 pm, mmccaws2 <mmcc...@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.
>
> Mike


while looking at man at again i see
at -f $HOME/future -t201312271220.00
is there a way of generating the date output similar to the format
used in the example
[year][month][day][24 hour][minute].[sec] + 30 sec.

Mike
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #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'.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 04-18-2008, 08:30 AM
Dennis Handly
 
Posts: n/a
Default Re: how to start script in 30 seconds

mmccaws2 wrote:

> is there a way of generating the date output similar to the format
> [year][month][day][24 hour][minute].[sec] + 30 sec.


date +%Y%m%d%H%M.%S
You'll have to figure out how to add 30.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9 (permalink)  
Old 04-19-2008, 06:17 AM
Michael Tosch
 
Posts: n/a
Default Re: how to start script in 30 seconds

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



(sleep 30 && ./startscripts &) </dev/null >/dev/null 2>&1


--
Michael Tosch @ hp : com
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #10 (permalink)  
Old 04-29-2008, 08:17 PM
Ulrich Windl
 
Posts: n/a
Default Re: how to start script in 30 seconds

mmccaws2 <mmccaws@comcast.net> writes:

> 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?


Besides reading "man at" users could use "man batch".

>
> Mike

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 08:06 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62