Does anybody know this??


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Does anybody know this??
# 1  
Old 06-24-2004
Does anybody know this??

Hi:
I am trying to SFTP some files thru Ksh I want to run the script(see below) thru scheduler. If I run this script it prompts for the password, Is there any way that it could be automated or read thru some file.
I know we could do it in FTP but FTP is not an option .. i HAVE to use SFTP

#!/usr/bin/ksh
$INFILE="Input.txt"
while read -r i
do
cd /home/$i/logs
/usr/bin/sftp user@host <<EOF >>output.log
put *.log
quit
EOF
done<$INFILE

I checked the FAQ's still doesn't help ... Also I am not sure whether I have I could create any *key or *pub files on the remote server.. I have to ftp from 8 different servers to the same server
Any feed back appreciated
Thanks
# 2  
Old 06-24-2004
Please read the rules of these forums. You are bumping your question by putting it in a second time.

And I don't know why you deleted most of the text of your original - but I know it's the same since I only read it this morning.

Try using the code you got from the thread as written - adding the user@host portion may have been why it still asked for a password (see thread ).
# 3  
Old 06-24-2004
RTM:
I guess I had to do that because looking at the subject ppl wont respond as they think I dint look at thread. Sorry about that
but the thread actually doesnt help me I if i take user@host off then, it gives me back

usage: sftp [-vC1] [-b batchfile] [-o option] [-s subsystem|path] [-B buffer_size]
[-F config] [-P direct server path] [-S program]
[user@]host[:file [file]]

Any solution?
# 4  
Old 06-25-2004
You still need the host bit. Just remove the user@ portion. You'll then need to add a "user username passwd" command in the here document to compensate.
Login or Register to Ask a Question

Previous Thread | Next Thread
Login or Register to Ask a Question