how to call an unix script in sequence job
Moderators: chulett, rschirm, roy
how to call an unix script in sequence job
Hi all,
Can anybody suggest me how to call a unix script in the job sequence.
In the 1st job I am sending one databas table to a file.
Then I have to call an unix script to operate on that file.
Can anybody suggest me how to call a unix script in the job sequence.
In the 1st job I am sending one databas table to a file.
Then I have to call an unix script to operate on that file.
Re: how to call an unix script in sequence job
you can use a execute command stage after the job that loads the data from DB into your file and then to call your .sh along with respective parameters.
Hi ,
I have to perform the sequence job bcz there is another job which will remove one file after executing the script.
In the exec command stage I tried basic unix commands like rm,cp and its working fine,but to execute the unix script while giving sh /data/script1.txt command I am not geting the result.
If I have to use ExecSh after job sub routine then what what parameters I have to pass?
can anybody suggest?
I have to perform the sequence job bcz there is another job which will remove one file after executing the script.
In the exec command stage I tried basic unix commands like rm,cp and its working fine,but to execute the unix script while giving sh /data/script1.txt command I am not geting the result.
If I have to use ExecSh after job sub routine then what what parameters I have to pass?
can anybody suggest?
Last edited by sjordery on Wed Apr 25, 2007 7:01 am, edited 1 time in total.
What result are you getting?
You don't need the 'sh' part on the front, simply put the fully pathed script in the Command box and then any parameters / arguments (if needed) in the Parameter box.
Run the job and then post whatever messages in the log relate to that stage.
You don't need the 'sh' part on the front, simply put the fully pathed script in the Command box and then any parameters / arguments (if needed) in the Parameter box.
Run the job and then post whatever messages in the log relate to that stage.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
Hi Craig,
In the log it is showing that sequence job is finished.
But the script is not getting executed.
I am able to run the script in the unix env and getting the result properly.
This is the log report I am getting.
----------------------------------------------------------------
mail_alert_seq..JobControl (@Execute_Command_11): Executed: /data/skscript
Reply=0
Output from command ====>
cat: skey.txt: No such file or directory.
----------------------------------------------------------------
Its showing skey.txt file not found but file is there and I am able to execute the script in the unix env.
Can you suggest what is wrong here?
Is there any other way to run the script?
In the log it is showing that sequence job is finished.
But the script is not getting executed.
I am able to run the script in the unix env and getting the result properly.
This is the log report I am getting.
----------------------------------------------------------------
mail_alert_seq..JobControl (@Execute_Command_11): Executed: /data/skscript
Reply=0
Output from command ====>
cat: skey.txt: No such file or directory.
----------------------------------------------------------------
Its showing skey.txt file not found but file is there and I am able to execute the script in the unix env.
Can you suggest what is wrong here?
Is there any other way to run the script?
Within the script, use fully qualified paths for any file you write to or reference. Your script is complaining that skey.txt is not present. Ofcourse not, the dsengine will look for this file in its home directory. Your script works from command line because skey.txt might be present in /data/ directory, the same as the script and hence it finds it and the script executes.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
I gave full path for the file skey.txt in the unix script.
Then after running the sequence I am getting following log report.
--------------------------------------------------------------------------------
mail_alert_seq..JobControl (@Execute_Command_11): Executed: /data/skscript
Reply=126
Output from command ====>
SH: line 1: /data/skscript: Permission denied
-----------------------------------------------------------------------------
nw its showing permission denied for the script.
Then after running the sequence I am getting following log report.
--------------------------------------------------------------------------------
mail_alert_seq..JobControl (@Execute_Command_11): Executed: /data/skscript
Reply=126
Output from command ====>
SH: line 1: /data/skscript: Permission denied
-----------------------------------------------------------------------------
nw its showing permission denied for the script.
Can you execute it from unix using the same id? If yes then try giving the command as
Code: Select all
. /data/skscript
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.