Make UNIX command disappear from the job log
Moderators: chulett, rschirm, roy
-
- Premium Member
- Posts: 457
- Joined: Tue Sep 25, 2007 4:05 pm
Make UNIX command disappear from the job log
Hello all,
I am just curious to find out how to make a UNIX command, executed from either a Before-job/After-job sub-routine or an Execute Command activity, disappear from the job's or the sequence's log. In other words, I want to "silently" (from a DataStage job log's perspective) execute a Unix script (which has password as one of the arguments).
The way DataStage is doing the execution right now is, it will provide a log entry for the command/script being executed. Unfortunately, this particular script has Database password being passed in as one of the input arguments. Even if I pass this password in the job from a Parameter Set (password entry is encrypted), the tool is generating the clear text during run-time and it is being displayed as part of the command being executed.
Thanks and do let me know if I need to provide any more information.
I am just curious to find out how to make a UNIX command, executed from either a Before-job/After-job sub-routine or an Execute Command activity, disappear from the job's or the sequence's log. In other words, I want to "silently" (from a DataStage job log's perspective) execute a Unix script (which has password as one of the arguments).
The way DataStage is doing the execution right now is, it will provide a log entry for the command/script being executed. Unfortunately, this particular script has Database password being passed in as one of the input arguments. Even if I pass this password in the job from a Parameter Set (password entry is encrypted), the tool is generating the clear text during run-time and it is being displayed as part of the command being executed.
Thanks and do let me know if I need to provide any more information.
Vivek Gadwal
Experience is what you get when you didn't get what you wanted
Experience is what you get when you didn't get what you wanted
-
- Premium Member
- Posts: 457
- Joined: Tue Sep 25, 2007 4:05 pm
Thanks Anbu.anbu wrote:Instead of passing password, store it in a file and inside your unix script read the file to get the password. Make sure to give proper permission to password file.
This approach is implemented currently in this shop. However, the folks here want to get away from that approach because of some issues they faced earlier. I tried calling the script through DataStage and thus I came across this issue! Please let me know if there are any alternatives
![Smile :)](./images/smilies/icon_smile.gif)
Vivek Gadwal
Experience is what you get when you didn't get what you wanted
Experience is what you get when you didn't get what you wanted
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
You could always create your own before/after subroutine, which does not put the entry into the log. Adapt the code of whatever routine you're currently using.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
-
- Premium Member
- Posts: 457
- Joined: Tue Sep 25, 2007 4:05 pm
Thanks Ray.ray.wurlod wrote:You could always create your own before/after subroutine, which does not put the entry into the log. Adapt the code of whatever routine you're currently using.
This is what I understood from your explanation: Create a "Server" routine and call the shell script from within it and make it not to display the command in the log. But, the jobs are in parallel and I cannot call this routine within that job. Could you please correct me if I understood you wrong?
Vivek Gadwal
Experience is what you get when you didn't get what you wanted
Experience is what you get when you didn't get what you wanted
-
- Participant
- Posts: 19
- Joined: Mon Feb 14, 2005 11:34 pm
-
- Premium Member
- Posts: 457
- Joined: Tue Sep 25, 2007 4:05 pm
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
All before/after subroutines are server routines, whether they're called from server jobs or parallel jobs. They can not be called directly from sequences but a simple interlude could be constructed.
Note - I need to check the Catalog name of ExecSHSilent to get this 100% correct, but won't be able to until I finish installing Information Server at my current site.
Code: Select all
FUNCTION ExecSHSilentInterlude(Arg1)
ErrorCode = 0
Call ExecSHSilent(Arg1, ErrorCode)
Ans = ErrorCode
RETURN(Ans)
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
-
- Premium Member
- Posts: 457
- Joined: Tue Sep 25, 2007 4:05 pm
Great!narasimha wrote:If you want to go the "Execute Command Activity" route -
Enter /NOLOG/ as the starting text in the parameter field.
This prevents the parameters from being logged in the job logs.
I did not know DataStage has these facilities. Thanks Ray, narasimha, anbu and shivaji!
Vivek Gadwal
Experience is what you get when you didn't get what you wanted
Experience is what you get when you didn't get what you wanted