[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index] [Date Index] [Thread Index]
[SQR-USERS Info] [SQRUG Home Page]

Re: [sqr-users] Unable to do a SFTP to a secure server



On 01/12/05, Robin_Ferebee@nexnet.navy.mil
<Robin_Ferebee@nexnet.navy.mil> wrote:
> Good morning.  I am attempting to FTP a file from my PeopleSoft unix
> server to a secure unix server.  I created a batchfile, but I'm not sure
> how to execute the command to ftp.  Here is my code:
>
>  Open $ScriptFile as 1 For-Writing Record=800 Status=#Open1
>   Let $ScriptData = 'user xxxx yyyyy'       !Production
>   Write 1 from $ScriptData
>   Let $ScriptData = 'lcd '||$Unix_dir
>   Write 1 from $ScriptData
>   Let $ScriptData = 'cd '||$Merch_Path
>   Write 1 from $ScriptData
>   Let $ScriptData = 'user ssh xxxxxx yyyyyy'
>   Write 1 from $ScriptData
>   Let $ScriptData = 'sftp merch@merchweb1'
>   Write 1 from $ScriptData
>   Let $ScriptData = 'eat34bugs2day'
>   Write 1 from $ScriptData
>    Let $ScriptData = 'put ' || $filename||' '|| $filename
>   Write 1 from $ScriptData
>   Let $ScriptData = 'quit'
>   Write 1 from $ScriptData
>   Let $ScriptData = 'exit'
>   Write 1 from $ScriptData
>   Close 1
>
> Let $BatchExec = 'sftp '|| '-B hqsun4 <' ||$ScriptFile ||'> ' ||
> $ScriptLog  {This line creates the error}

I think you want -b here, the -B parameter is usually to adjust the
buffer size, and from you command you probably want the batch file to
be a dash meaning stdin and sftp needs the user and host on the
command line.

let $BatchExec = 'sftp -b - user@host < ' || $ScriptFile || ' > ' || $ScriptLog

> Let $CommandString = $BatchExec
> Call System Using $CommandString #Status Wait

Usually you will want the ssh set-up to function with public key
authentication so there is no need to enter a password, makes things
much simpler.

--
...Rob

-- No trees were killed in the sending of this message.  However a
large number of electrons were terribly inconvenienced.

================================================
Robert Goshko
Registered Linux User #260513

Want a Gmail account, 2.6+ GB web mail (for free),  just ask me.

_______________________________________________
sqr-users mailing list
sqr-users@sqrug.org
http://www.sqrug.org/mailman/listinfo/sqr-users