[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: How to schedule for a repeated task?



On Thu, May 06, 2010 at 08:48:48AM +0100, hadi motamedi wrote:
> I tried as the followings :
> #autoexpect -c
> 
> #telnet 172.16.17.160
> ->command1
> ->logout
> #exit
> It has produced an script named 'script.exp' . When I run this script , I
> see automatic telnet to the VxWorks remote node and then issuing the desired
> command but to exit I need to press Ctrl-C . Then I tried to automate it
> like the following :
> 
> #for i in 1 2 3 4 5
> >do
> >./script.exp
> >sleep 10
> >done
> It is quite ok , except for the need that I must press Ctrl-C at the end of
> every run . Can you please let me know how to remove that un-necessary
> hitting of Ctrl-C ?

When exactly you need to press Control-C? After exiting the remote
node? Before? I'd really need to look at the script you are using, the
one produced by the autoexpect session, but you could try either sending 
an extra `exit' string or sending a control-C (send \003)
Take a look here¹ for more ASCII Control Characters.

Regarding the second part, the way you automate the task can't be
really called _scheduling_, (i.e., a script will be executed every
Sunday at 13:00). That is _iteration_, your script will be executed
five times in a row. But I think you know better than me what you want to 
accomplish with it.

Regards.

¹http://en.wikipedia.org/wiki/ASCII

-- 
Huella de clave primaria: 0FDA C36F F110 54F4 D42B  D0EB 617D 396C 448B 31EB

Attachment: pgp1dnWpjHiLF.pgp
Description: PGP signature


Reply to: