problem running expect script via cron 
Author Message
 problem running expect script via cron

I am having trouble running an expect script using cron on my
NeXT computer. The script is intended to ftp off files for
backup on a remote host. It works from the command line, but
not when invoked via cron. One error message I consistently
get when running it from a shell is "unknown mode: sane", but
the script runs anyway.

Any suggestions would be appreciated.

#!/usr/local/bin/expect -f
set env(TERM) vt100
spawn ftp anywhere.ucsf.edu
set timeout -1
expect "Name "
send "username\r"
expect "Password:"
send "userpasswd\r"
expect "ftp> "
send "binary\r"
expect "ftp> "
send "send file.tar.gz\r"
expect "ftp> "
send "quit\r"


Division of Biostatistics
University of California, San Francisco



Sat, 17 Jan 1998 03:00:00 GMT  
 problem running expect script via cron

   Path: dove.nist.gov!uunet!in2.uu.net!cs.utexas.edu!howland.reston.ans.net!agate!stephen

   Newsgroups: comp.lang.tcl
   Date: 1 Aug 1995 23:17:54 GMT
   Organization: University of California, Berkeley
   Lines: 29
   NNTP-Posting-Host: crow.berkeley.edu

   I am having trouble running an expect script using cron on my
   NeXT computer. The script is intended to ftp off files for
   backup on a remote host. It works from the command line, but
   not when invoked via cron. One error message I consistently
   get when running it from a shell is "unknown mode: sane", but
   the script runs anyway.

   Any suggestions would be appreciated.

   #!/usr/local/bin/expect -f
   set env(TERM) vt100
   spawn ftp anywhere.ucsf.edu
   set timeout -1
   expect "Name "
   send "username\r"
   expect "Password:"
   send "userpasswd\r"
   expect "ftp> "
   send "binary\r"
   expect "ftp> "
   send "send file.tar.gz\r"
   expect "ftp> "
   send "quit\r"


   Division of Biostatistics
   University of California, San Francisco

Quick fix is to edit the Makefile and replace "sane" with "cooked".
(And reinstall.)  Modern versions of Expect do that when they see that
they are running on Mach.

Don



Sun, 18 Jan 1998 03:00:00 GMT  
 problem running expect script via cron

Quote:

>I am having trouble running an expect script using cron on my
>NeXT computer. The script is intended to ftp off files for
>backup on a remote host. It works from the command line, but
>not when invoked via cron. One error message I consistently
>get when running it from a shell is "unknown mode: sane", but
>the script runs anyway.

Can you run "stty sane" from your shell without error?  If not, then
expect is probably not built correctly.

When something works when you run it manually but not when run under
cron, your script is probably depending on inheriting your tty settings
that it doesn't get from cron.  If fixing the first problem doesn't
fix this, use spawn's -nottycopy option to get rid of the inheriting
from your own login, and then figure out which stty settings you need
to set up explicitly.
--
Danny Faught -- Convex -- Operating System Demolitions Specialist
Magister artis ingeniique largitor venter.



Sun, 18 Jan 1998 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. expect: problems running script from CRON

2. Problems running expect script in the background/from cron

3. trouble running an expect script in cron versus command line

4. trouble running an Expect script from cron

5. Running expect scripts from cron..?

6. Running EXPECT script through cron

7. cannot run expect script under cron

8. Still problems running script from cron

9. Problem running Python script as cron job

10. running ssh from an expect script via abrowser

11. Problems running php-script via CGI

12. Set expect script variables via a korn shell script

 

 
Powered by phpBB® Forum Software