The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Unable to sftp with cron (once more time...) Kronos UNIX for Dummies Questions & Answers 7 05-06-2009 11:21 AM
SFTP Failed---Request for subsystem 'sftp' failed on channel 0 mahiban AIX 0 07-25-2008 03:51 AM
SFTP not exiting when run from cron msabhilash SUN Solaris 2 12-02-2007 07:48 PM
SFTP not working in cron ewilson0265 Shell Programming and Scripting 4 12-02-2007 11:29 AM
SFTP errorcode 1 when run on cron but runs manually Heidi.Ebbs SUN Solaris 2 08-08-2007 01:16 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 11-13-2008
r1omen r1omen is offline
Registered User
  
 

Join Date: Nov 2008
Posts: 2
Thumbs down sftp in cron

Hi,

I am running simple script to automate sftp transfer to remote box. I have setup public/private keys to have sftp connect automatically and have test script that list remote directory:


Code:
#!/bin/ksh

echo "OK, starting now..."

  sftp userid@host <<EOI
  cd dir
  ls -lt
  bye
EOI

When I run script manually everything is ok and script executeds properly with output:


Code:
OK, starting now...
sftp>   cd dir
sftp>   ls -lt

<dir list>

sftp>   bye

When run through cron I get only the following:


Code:
OK, starting now...

Can anyone tell me what I am doing wrong or where the problem sits?
  #2 (permalink)  
Old 11-13-2008
zaxxon's Avatar
zaxxon zaxxon is online now Forum Staff  
Moderator
  
 

Join Date: Sep 2007
Location: Germany
Posts: 2,323
Use the seach function of the forum please and have a look here maybe:
cron and crontab
  #3 (permalink)  
Old 11-14-2008
r1omen r1omen is offline
Registered User
  
 

Join Date: Nov 2008
Posts: 2
Thanks for the link - this is very useful info.

It does also what I already found out. I just need to set PATH for the script to match the one in my .profile file.

Thanks!
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 07:49 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0