The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #3 (permalink)  
Old 06-28-2006
ewilson0265 ewilson0265 is offline
Registered User
  
 

Join Date: Jun 2006
Posts: 2
Jim,

Thanks for your reply. We have generated keys on both the source and destination machines authenticating the user. We are running the script from this user. If I type it manually from a command prompt "TestSFTP.sh", it works fine. However when I put it in cron it doesn't.

As a further test, I put in an additional line in cron to send me an email.

#!/bin/ksh
mailx -s "Test" myemail@myemail.com < /path/TestSFTPcron.txt
cd /localpath
sftp remotename@remotehost:/remotepath <<EOF
mput Test.txt
bye
EOF

When I do this, it also works completely fine when I run it manually. However, in cron I so receive the email but the file is not put on the remote machine.

It looks like the script is partially working...

Last edited by ewilson0265; 06-28-2006 at 04:56 PM..