|
This may help. It sends a single file. Environment variables are used.
#!/bin/sh
build_script() {
cat <<End-of-message
#!/usr/local/bin/expect -f
set timeout 20
spawn /QOpenSys/usr/bin/sftp ${USER}@xxx.com
expect {
default {exit 2}
"Connecting to ...\r\n"
}
expect {
default {exit 3}
default {exit 3}
"password:"
}
send "${PASSWORD}\n"
expect {
default {exit 4}
"sftp>"
}
set timeout 7200
send "put ${PUTFILE}\n"
expect {
default {exit 5}
"sftp>"
}
send "quit\n"
send "quit\n"
exit 0
End-of-message
}
build_script | /usr/local/bin/expect -f -
John McKee
On Tue, Jun 24, 2014 at 10:24 AM, Jim Franz <franz9000@xxxxxxxxx> wrote:
i don't have any script yet. Other side not supplying any. This is
unattended.
Basic an edi file send, and later and edi response.
Would appreciate a script if you have it
jim
On Tue, Jun 24, 2014 at 10:09 AM, John McKee <jmmckee@xxxxxxxxxxxxxx>
wrote:
I had several sftp sessions on our i, after Scott's assistance.morning.
Are you using an expect script?
Are you tryng to run as an unattended process?
I can send a script to you if that helps.
John McKee
On Tue, Jun 24, 2014 at 8:56 AM, Jim Franz <franz9000@xxxxxxxxx> wrote:
I have a sftp to setup (today) on i but no mention of keys in spec.
Have user/password, and this stmt "Connection SFTP (port 22)"
when I try just ftp connection on port 22, get response
SSH-2.0-1.36_sshlib GlobalSCAPE
I tried to reach scottklement.com/openssh but site not responding
Our normal sftp is thru win server but tech's wife had baby this
listlist
Need these 3 steps
connect > send
connect > dir > (to a log file to determine if new file to get
connect > get
Any pointers appreciated.
Jim Franz
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing
To post a message email: MIDRANGE-L@xxxxxxxxxxxx--
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing
To post a message email: MIDRANGE-L@xxxxxxxxxxxx--
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.