Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
I've got an expect script that is run through cron everynight that is supposed to secure copy a few files from a different server as well as do a few other things. I can't use ssh-agent because I have extremely limited access to the server I need to copy from.
The problem is when I run the script through cron, it executes scp but never winds up copying the files. All the paths I have are absolute paths and I've created a wrapper to set the environment variables for LD_LIBRARY_PATH and PATH under cron.
This script works fine when run from the command line. Any ideas?
Expect script:
spawn scp IPADDRESS:/common/file.log /home/filecopy.log
expect "(yes/no)?"
send "yes\r"
expect "password:"
send "******\r"
interactWrapper:
#!/bin/bashLD_LIBRARY_PATH=/usr/local/src/tcl8.3.2/unix/
export LD_LIBRARY_PATHPATH=:/usr/sbin:/opt/openssh/bin:/usr/bin:/usr/local/bin:/apps/RCS:/usr/ccs/bin:/usr/local/sbin:/usr/bin:/usr/ucb:/etc:.:/usr/
local/bin:/apps/RCS
export PATH/home/thescript.exp

Try turning on expect debugging to see the output
exp_internal 1
Most likely it is a path and environment problem if the script runs interactively but not from cron.

![]() |
unix shell design
|
FTP files in an interval
|

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |