----- Original Message -----
From: "Pickering, John (NORBORD)" <[log in to unmask]>
To: <[log in to unmask]>
Sent: Wednesday, May 01, 2013 09:29 AM
Subject: [HP3000-L] can ftp execute a unix script
For years our 9000 has used ftp to put files on the 3000 and then submit
a job with "site stream".
Is it possible for the 3000 to do the same on the 9000?
[Keven]
Having done some work with FTP for Transfomix, this question interested me.
Yes - it can be done.
So (on my XP laptop) I opened an ftp session to my HPUX 11.11 system.
==========================================
ftp> help
Commands may be abbreviated. Commands are:
! delete literal prompt send
? debug ls put status
append dir mdelete pwd trace
ascii disconnect mdir quit type
bell get mget quote user
binary glob mkdir recv verbose
bye hash mls remotehelp
cd help mput rename
close lcd open rmdir
ftp>
==========================================
I see I have a "quote" command so I can pass commands onto the remote
server.
==========================================
ftp> remotehelp
214-The following commands are recognized (* =>'s unimplemented).
USER PORT STOR MSAM* RNTO NLST MKD CDUP PBSZ*
PASS PASV APPE MRSQ* ABOR SITE XMKD XCUP PROT*
ACCT* TYPE MLFL* MRCP* DELE SYST RMD STOU SIZE
SMNT* STRU MAIL* ALLO CWD STAT XRMD AUTH* MDTM
REIN* MODE MSND* REST XCWD HELP PWD ADAT*
QUIT RETR MSOM* RNFR LIST NOOP XPWD CCC*
214 Direct comments to [log in to unmask]
ftp> remotehelp site
214-The following SITE commands are recognized (* =>'s unimplemented).
UMASK CHMOD GROUP NEWER INDEX ALIAS GROUPS
IDLE HELP GPASS MINFO EXEC CDPATH
214 Direct comments to [log in to unmask]
ftp>
==========================================
The remote ftp has a SITE command, AND that SITE command has an EXEC
command.
Of course my testing still fails.
Googled for help.
http://h30499.www3.hp.com/t5/System-Administration/11-0-ftp-and-SITE-EXEC-how-to/td-p/2561210
==========================================
08-03-2001 01:50 AM
11.0 ftp and SITE EXEC: how to?
With HP-UX 11.0, ftpd is based on wu-ftpd and supports the SITE commands.
I'm trying to get SITE EXEC to work.
I can ftp to my target system and issue the "site exec testme" command,
which returns without error, but my testme file
(a test script which echoes date to a file in /tmp) does not seem to have
run. When I run the testme script by hand as the
same user that I ftp as: /etc/ftpd/ftp-exec/testme it shows as "not found"
because of the permissions on the directories,
although the testme file is owned by my login user and is executable. I
think the problem might be the location of the script,
which I assume is supposed to be /etc/ftpd/ftp-exec. Has anyone gotten this
new feature to work and if so,
how did you do it? Thanks in advance.
08-03-2001 04:41 PM
Re: 11.0 ftp and SITE EXEC: how to?
Well, it does work if you chmod /etc/ftpd and /etc/ftpd/ftp-exec to 555. In
the long run, that may not be as secure as
the default 544 permissions, but the documentation does state that "site
exec" adds an inherent level of risk if it is enabled.
Perhaps this is why...it's working now.
==========================================
Ah, looks like I need to put a script into /etc/ftpd/ftp-exec/ and fix the
modes of the directories.
But still no go.
Another google entry
http://nixdoc.net/man-pages/HP-UX/ftpd.1m.html
==========================================
The following non-standard or HP-UX specific commands are supported by
the SITE command:
Command Description
UMASK Change umask. (e.g., SITE UMASK 002)
IDLE Set idle-timer. (e.g., SITE IDLE 60)
CHMOD Change mode of a file. (e.g., SITE CHMOD 755
filename)
HELP Give help information. (e.g., SITE HELP)
NEWER List files newer than a particular date.
MINFO Works like SITE NEWER, but gives extra
information.
GROUP Request for special group access. (e.g. , SITE
GROUP foo)
GPASS Give special group access password. (e.g. , SITE
GPASS bar)
EXEC Execute a program. (e.g. , SITE EXEC program
params)
For the SITE EXEC command, in order to execute a program it has to be
placed in the /etc/ftpd/ftp-exec directory. The program to be executed
must be either a binary program file or a valid shell. For example for
the following program:
cat /etc/ftpd/ftp-exec/hi.sh
#!/usr/bin/sh
echo hello
When we give the following SITE EXEC command:
ftp> site exec hi.sh
The output will be as follows:
200-hi.sh
200-hello
200 (end of 'hi.sh')
==========================================
Ah, my script may need the "#!/usr/bin/sh" header.
file myfile
#!/usr/bin/sh
date
==========================================
ftp> quote site exec mydate
200-mydate
200-Wed May 1 10:10:14 MDT 2013
200 (end of 'mydate')
ftp>
==========================================
Success!!!
Keven Miller
* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *
|