1832595 Members
3018 Online
110043 Solutions
New Discussion

FTPD and SITE EXEC

 
Dave La Mar
Honored Contributor

FTPD and SITE EXEC

I am trying to use SITE EXEC to start a script on an 11.0 box. In following previous posts, I have set ftpd and ftp-exec to 555 and placed the script in ftp-exec. Even if I log in as root it doesn't execute (it's just a sleep 120 for testing purposes).
I am coming from a none HP-UX environment using ftp for this.
My final intent is to start sqlldr to populate an oracle database on the HP-UX box.
Any ideas would be greatly appreciated.
"I'm not dumb. I just have a command of thoroughly useless information."
4 REPLIES 4
harry d brown jr
Honored Contributor

Re: FTPD and SITE EXEC

Shannon Petry
Honored Contributor

Re: FTPD and SITE EXEC

Another thing that I use, but many here dont is a .netrc file. This will automate ftp based on an init macro you can define in netrc file.
1. man netrc

Steps required.
1. create a user ID and give them access to run cron jobs in /usr/lib/cron/cron.allow
2. in the users home directory build a .netrc file. The init macro should perform all of the commands you need. I.E.
bin
prompt
lcd /somedir
cd /someotherdir
mput *.log
mget *.Z
bye

3. Build a script to do any before the ftp and after the ftp work that is required, then launch ftp within the script.

The biggest mistake people make with a netrc file is permissions. A minimum of -rw------- (0600) and preferrably -r-------- (0400) should be set, and of course the owner must be set properly.

I find that this method is more fool proof than trying to directly script ftp commands and easier to maintain. It also allows you to issue the ftp command as the user, and see exactly what it is doing.

Regards,
Shannnon
Microsoft. When do you want a virus today?
Dave La Mar
Honored Contributor

Re: FTPD and SITE EXEC

Thanks Harry and Shannon. Actually the link was one of the sources I refernced and followed.
Let me explain further -
1. I have site exec working as of today. (Don't know what's different from yesterday's testing, but it does work.)
2. I am coming in through ftp from an IBM mainframe.
3. There are several steps to the IBM job stream.
4. When I execute the script on the unix box, the mainframe job waits for the script to finish before continuing on the the next step.
5. I want the script to kick off on unix but return to the mainframe job immediately after starting the script.
6. Event if I send the script command to the background the mainfram job waits for any child process to finish as well.

Any ideas? I have nohupped myself to death on this.
"I'm not dumb. I just have a command of thoroughly useless information."
Dave La Mar
Honored Contributor

Re: FTPD and SITE EXEC

I have found an interim workable solution.
1. Call a script that creates a cron job for the script I want to run.
2. This appears to create a child process for the cron entry but ends when the entry is made.
3. Control is returned to the mainframe job stream as the ftp job has finished.

There may be a better way to do this, but since I am totally new to HP-UX, in my ingnorance this is the best I have come up with.

Thanks for your help and input.
dl
"I'm not dumb. I just have a command of thoroughly useless information."