× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Hello Scott,

Thankyou very much for your help, I was unsure on how to do the command
but that example you provided below worked perfectly !!! :-)

QSH CMD('ssh -l my-userid hostname.com ls -l > filename')

Thanks again
Andrew




Scott Klement <midrange-l@xxxxxxxxxxxxxxxx>
Sent by: midrange-l-bounces@xxxxxxxxxxxx
04/08/2012 22:33
Please respond to
Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxx>


To
Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxx>
cc

Subject
Re: Retrieve remote ls command results






Hi Andrew,

It's unclear to me which side acts as the SSH server, and which side is
running the SFTP command to retrieve the data.

On the client side (the side that runs the 'SFTP' tool) you should be
able to retrieve the size of the file via the 'ssh' command. It has the
capability of runnign remote commands (by connecting to the same SSH
server you used for SFTP)

To run a remote command, simply append the command after the hostname.
For example:

ssh -l my-userid hostname.com ls -l

If the client-side software is running IBM i, this is best done from
QShell, and can be redirected to a data area, file, etc as you've
already suggested in your previous post.

QSH CMD('ssh -l my-userid hostname.com ls -l > filename')

Make sense?



On 8/3/2012 9:45 AM, Andrew.Smith@xxxxxxxxx wrote:
Hello,

I have a batch CL function which sends a .ZIP file to our client via
SFTP.I have retrieved the size of the .ZIP from our IFS by using QSH to
‘ls -l’ the details
and redirect this output to a data area from which I can extract the
size.


I now need to retrieve the size of the same file from our client (as
part
of our customer SLA) by using SFTP or QSH or QP2TERM to ensure that the
transfer
completed successfully by comparing the file sizes.

Does anyone have any help/examples on how to run an 'ls' command on the
clients machine and get the output back in batch ?
There seems to be an answer on this thread -
http://www.iprodeveloper.com/forums/aft/55771 but unfortunately I do not
really understand how it works.

Any help/examples will be very gratefully received.

Thankyou


As an Amazon Associate we earn from qualifying purchases.

This thread ...

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.