Cron Job not running ssh script
Hi,
I wrote an expect script that ssh into a remote machine and kicks off a perl script. It runs fine when i run it manually; but, when i try to run it using cron it gives me errors. Is there something that i need to do with respect to cron? I think its's something to do with cron not having the correct environment variables within the remote machine.... Can anyone shed any light on this? Thank, Karim0028 |
What are the errors? Is it possible to post some or all of the script (minus any sensitive info)?
|
Sorry, i posted this from home and the script was at work....
Here it is: #!/usr/bin/expect -f spawn -nottycopy /usr/bin/ssh root@machine.com expect "\#" {send "cd /ult-bldsys\r"} expect "\#" {send "export DISPLAY=:0.0\r"} expect "#" {send "exec /usr/bin/perl /ult-bldsys/test&\r"} #This is commented out for trial purpose, trying exec vs. spawn #vs. send #expect "#" {send "perl /ult-bldsys/test&\r"} expect eof #expect "#" {send "exit\r"} |
Also, when i try to run this from the command line it seems to return but the perl script doesnt continue on the remote machine. If i type "interact" at the end it works. As is; it starts manually but when expect terminates, the perl script terminates
Please illuminate me if any one has any ideas of how to get it working. Thanks, Karim0028 |
All times are GMT -5. The time now is 09:29 PM. |