In this can tell you that it does not get a different IP. While this server has many IP addresses as it supports many services and web sites, it has the default route bound to one single IP address.

Plus the fact that the script never appears to even run, we do not see the 'spawn sftp ...' happen. It simply returns to the $ prompt silently creating an empty log file if we're redirecting.

- Larry "DrFranken" Bolhuis

www.Frankeni.com
www.iDevCloud.com - Personal Development IBM i timeshare service.
www.iInTheCloud.com - Commercial IBM i Cloud Hosting.

On 9/7/2016 11:17 PM, John McKee wrote:
This may be wild. Is there a possibility that your session is assigned a
different IP address, via DHCP on your end? I didn't have that nasty
issue, but a remote site was only allowing a connection from a specific IP
adddress.

If you put "-vvv" on your sftp command, inside the script, you will get an
amazing amount of output. Do that, and you might see something
interesting. But, because you are looking for a failure, it might take a
whie to pop up. Look at the output from a good session to see the
handshaking. Sometimes, as with job logs, a error is sent that only later
causes a failure.


John McKee

On Wed, Sep 7, 2016 at 9:56 PM, DrFranken <midrange@xxxxxxxxxxxx> wrote:

We'll likely convert it to a CL. Currently we're submitting the QSH
'sftp.sh > sftp.log' command directly. It has worked and it has failed.

It has ALSO failed while in QSH. I run it thus:
================================
./sftp.sh
$
================================
Absolutely nothing between the command and the $.

Perhaps the next time though, it WORKS and you get:
================================
./sftp.sh
spawn sftp GrandRapids@mft.********.com
GrandRapids@mft.********.com's password:
WARNING: USE OF THIS SYSTEM IS RESTRICTED TO AUTHORIZED USERS
This computer is the private property of the Company and may be...
<snip>
Connected to mft.********.com...
sftp> ls -l
-rw-rw-rw- 1 user group 324 Sep 7 19:11 Agent_xx.OLD
-rw-rw-rw- 1 user group 0 Sep 7 19:11 Office_xx.OLD
<snip>
sftp> mput *.txt
Uploading agent.txt to /agent.txt
agent.txt 100% 265 0.3KB/s 00:00
Uploading office.txt to /office.txt
office.txt 100% 0 0.0KB/s 00:00
sftp> $
===============================================

So it's a pretty dramatic difference. Either works or NOTHING!

And that's the frustrating part. How do you see what's happening when it
does NOTHING?

- Larry "DrFranken" Bolhuis

www.Frankeni.com
www.iDevCloud.com - Personal Development IBM i timeshare service.
www.iInTheCloud.com - Commercial IBM i Cloud Hosting.

On 9/7/2016 7:39 PM, Scott Klement wrote:

Larry,

I would not recommend using a redirect like > because that only
redirects "standard output" (stdout) which is where normal output
messages are written -- it does not log "standard error" (stderr) which
is where error messages are written.

Assuming you are running this from a CL program, I would use the
QIBM_QSH_CMD_OUTPUT variable to specify a file that output is written to.

Unfortunately a description like "does absolutely nothing" doesn't give
us much to go by.

-SK



On 9/7/2016 2:58 PM, DrFranken wrote:

I am utilizing expect on several different servers. On one of them we
need to sftp two small files up to a service periodically through the
day. When I run the shell script in QSH it will run perfectly. Then I
run it again and it does absolutely nothing. It may be many minutes
before it will run again. Signing off and back on doesn't consistently
fix it either. When submitted to batch it's the same, it may run and may
not.

I am redirecting standard output to a log file (> 'output.log') and when
it runs correctly everything is in it. When it does not run the file is
correctly time stamped but is empty (0 bytes). Even when it's not
logging it may fail, in that case if it's interactive QSH simply returns
to the '$' prompt.

IBM i 7.1 with reasonably current PTFs and the latest version of expect
from ScottKlement.com.

Thoughts??


--
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.

Please contact support@xxxxxxxxxxxx for any subscription related
questions.


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

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.