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



Are the commands you're running allowed to run in batch?
--
Sean Porterfield

-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx [mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of craigs@xxxxxxxxx
Sent: Monday, February 13, 2012 10:00
To: midrange-l@xxxxxxxxxxxx
Subject: Fw: SFTP batch local system commands issue


I should clarify the most important issue here.
I searched the internet carefully and still haven't found anything. I'm looking for a general direction on why using the local system (!system
"<cmd>") from SFTP within QSH command entry would work but not from an SFTP batch script run interactively. I must not have something set right that others have set.
I tried the -i option and -bOE. I thought the -i option would ensure the job wouldn't be spawned just in case but it didn't make a difference. I looked at the IBM examples and they work from the command entry but not from an interactive CL (or probably batch). I tried setting environment variables that the IBM site said were set automatically from command entry.
There are no errors set in the error log or output. I tried various commands and they state to complete fine but they aren't even touched. I'm not doing any expect scripts or anything complex. Just login, !system "<cmd>", quit. I could try to focus on settings again but I don't really know what to focus on. Could there be something not set in SFTP configuration? Has anyone gotten this to work?

Thanks.
Craig Strong
----- Forwarded by Craig Strong/DEKKO on 02/13/2012 09:46 AM -----

From: Craig Strong/DEKKO
To: midrange-l@xxxxxxxxxxxx,
Date: 02/06/2012 02:22 PM
Subject: SFTP batch local system commands issue


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

--


This email is confidential, intended only for the named recipient(s) above and may contain information that is privileged. If you have received this message in error or are not the named recipient(s), please notify the sender immediately and delete this email message from your computer as any and all unauthorized distribution or use of this message is strictly prohibited. Thank you.

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.