Page 1 of 1

using .netrc with an FTP shell script

Posted: Wed Jul 27, 2005 11:45 am
by lebos
What more can I say?

The AIX shell script executes FTP on order to transfer multiple files from a Novell server, using .NETRC for user authenitcation. When run directly from a Unix command line, it works like a champ. When run from a job sequence Execute Command activity, it gets "Intruder Dectected" from Novell. Log in user is the same in both cases.

I don't want to use the FTP stage, primarily because this job will sometimes have over a thousand jpeg files to transfer and I can't imagine doing that with the FTP stage.

As usual, any ideas appreciated!

Larry

Posted: Wed Jul 27, 2005 9:45 pm
by ray.wurlod
I vaguely recall that FTP will not permit redirection of the password. The way that DSExecute works (and, I assume, the way that the Execute Command activity works), is to fork a child process. Therefore you have redirection.

You might like to try a Routine Activity, in which your routine uses PERFORM statement rather than DSExecute. PERFORM operates within the same shell. But I can't guarantee it.

Other possibilities are to have DataStage trigger an independent process, for example via an at command.

Posted: Thu Jul 28, 2005 7:25 am
by lebos
Thanks Ray for the suggestions. I really had not even thought about using the at command and was about to give it a try when I thought of one other thing. That was that it seemed that there must be some kind of environmental difference. After looking around it turned out that $HOME was not set when the script was called from the Command Activity stage. When I got that set, everything was OK.

So, this is working, at least for now. .netrc files are frowned upon by our cyber security folks, so some day we'll have to switch to some other authentication method.

I also see that I should do a better job of proofing my comments!!

Thanks again.

Larry

Posted: Thu Jul 28, 2005 9:48 pm
by ray.wurlod
So you've now set HOME in the dsenv file, yes?

Posted: Mon Aug 08, 2005 11:43 am
by lebos
Actually no. That will ultimately be done I expect, but just to expedite testing, I set it in the script. (I was trying to get away for a week and took any shortcut I could!)

Larry

Posted: Mon Aug 08, 2005 1:15 pm
by kduke
On some UNIX machines it is possible to allow or not allow redirection into ftp. The .netrc is for inbound ftp. I would try it first.