using .netrc with an FTP shell script

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
lebos
Participant
Posts: 74
Joined: Mon Jan 20, 2003 10:02 am
Location: USA

using .netrc with an FTP shell script

Post 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
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
lebos
Participant
Posts: 74
Joined: Mon Jan 20, 2003 10:02 am
Location: USA

Post 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
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

So you've now set HOME in the dsenv file, yes?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
lebos
Participant
Posts: 74
Joined: Mon Jan 20, 2003 10:02 am
Location: USA

Post 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
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post 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.
Mamu Kim
Post Reply