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




I am trying to use the SFTP script !system "<command>" for running a local
command during SFTP. This works fine from the QSH screen but I cannot seem
to get the same commands to do anything from a CL program. The commands
just don't execute and I'm not seeing any related searches on the internet
for this. I tried various options and environment variables to no avail.
So, I have gone on to other methods. I am not using an expect script or
anything complex. One thing I think I should make known is that I have
also created my own SFTP automation programs to meet business requirements.
I am not stating that these are comprehensive but I could open them up for
sharing if desired. I created one command to create SFTP script on the fly
given parms. The main thing here is creating the temp error and output
files with flexible options and pre/post FTP commands. I created another
command to provide an LSCMD parm to ls -l to an outfile. Something never
done as far as I know. I also included options for number of minutes in
the past to pull using the ls -l modification date. Basically, it takes
the entire output from the script and pulls out the file listing and pays
attention to modification dates and times. If "get" and "rm" are parms, it
will have "get <file>" then "rm <file>". The business requirement is
basically so I don't "get" a file while it is being written. This also
overcomes in a way not being able to view file locks. This philosophy may
carry to the dynamic FTP (non-SFTP) script command I run (no, not FTPAPI
although that is very good). In general for SFTP "get",
1. Run a command to SFTP, ls -l, exit.
2. Run a command to create the "get" script of files modified over 5
minutes ago given the output from command 1. ("get <file1>" "rm <file1>"
"get<file2>" "rm <file2>")
3. Run the resulting SFTP script.

If I could run the !system "<command #2 from above>" as a parm in command
1, I would avoid the time of connecting again which is the portion that
takes a long time. I would just have the script local command write to the
input script dynamically on-the-fly. In theory, it should work, but I
cannot get any local system commands to run from CL like I can from the
STRQSH command entry.
Any ideas?

Thanks.
Craig Strong


As an Amazon Associate we earn from qualifying purchases.

This thread ...


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.