![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| sftp not working as cronjob | tungaw2004 | UNIX for Dummies Questions & Answers | 3 | 01-10-2008 08:27 PM |
| Cron not working | manna | UNIX for Dummies Questions & Answers | 1 | 01-10-2008 02:04 PM |
| SFTP not exiting when run from cron | msabhilash | SUN Solaris | 2 | 12-02-2007 07:48 PM |
| SFTP errorcode 1 when run on cron but runs manually | Heidi.Ebbs | SUN Solaris | 2 | 08-08-2007 12:16 PM |
| Cron not working? | christo16 | UNIX for Dummies Questions & Answers | 5 | 03-09-2007 02:55 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
SFTP not working in cron
Hi,
I have a simple script that is trying to put a file that resides on a local machine to a remote machine. It runs fine manually but does not complete when scheduling to run in cron. Here is what the script looks like. Any idea what I am doing wrong here? #!/bin/ksh cd /path sftp remoteuser@remotehost:/path <<EOF mput Test.txt bye |
|
||||
|
Code:
#!/bin/ksh cd /path sftp remoteuser@remotehost:/path <<EOF mput Test.txt bye EOF sftp used that way requires that authentication keys be set up on the remote host. What local user is authenticated to remoteuser on the remotehost? And is the script running as that user, ie., do you su to the required local user? |
|
||||
|
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 03:56 PM.. |
|
||||
|
Hi,
Have you go this problem resolved ? even I am facing a similar problem. My script works fine when run manually from command prompt, but it is failing when put in to the crontab. How did you fix this problem? Thanks. Abhi. |
| Sponsored Links | ||
|
|