From: Reinhard Max <max@tc...> - 2005-05-22 12:31:02
On Sun, 22 May 2005 at 12:12, Docume wrote:
> I have a problem with an expect script, it runs correctly under the
> shell but it is unable to run under cron job. As I read it seems to be a
> environment problem when it runs from crontab.
> The problem is:
> spawn telnet 10.10.14.5
> send: spawn id exp0 not open
> while executing
> "send_user "\nError: EOF received\n""
the [send_user] and [expect_user] commands are for communicating with the
user who has started the script via the terminal, but there is no terminal
and no user when the script is running as a cron job. You might want to
use [puts] instead to send those messages to stdout or stderr, so that you
can see them in the email you get from cron when the job is done.
From: Reinhard Max <max@tc...> - 2005-05-22 14:29:34
On Sun, 22 May 2005 at 13:26, Docume wrote:
> Let me know if I understand it correctly. I should replace all
> "send_user" and "expect_user" comands with "puts", shouldn't I?
Yes, and no. You should use puts instead of send_user for the output of
your script, but using expect_user (or any other command that wants to
read user input) simply doesn't make sense in background processes like
cron jobs that aren't connected to a user from which they could request
Get latest updates about Open Source Projects, Conferences and News.