For Programmers: Free Programming Magazines  


Home > Archive > Tcl > February 2007 > Re: Expect to implement a script to be run at a fixed time everyday without human int









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: Expect to implement a script to be run at a fixed time everyday without human int
Glenn Jackman

2007-02-26, 7:13 pm

At 2007-02-26 04:27PM, "Bryan Oakley" wrote:
> Schubert wrote:
>
> You want to use the unix command "cron".


Well, pedantically, he wants to use "crontab" and ask his symin to
ensure the cron daemon is running.

Schubert, the entry in your crontab will look like (assuming your script
will run at 8:00 am):

00 8 * * * /path/to/my/expect/script

Note that the environment your script will run in is not the same as
your login shell -- make sure that any programs that you spawn appear in
cron's PATH. I usually specifiy the full path to programs in my spawn
commands.

Also, if you want the output to be sent to a particular email address,
write the crontab entry something like this:

00 8 * * * /path/to/my/expect/script 2>&1 | /usr/bin/mailx -s "expect script output" foo.bar@example.com

--
Glenn Jackman
"You can only be young once. But you can always be immature." -- Dave Barry
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com