dsjob not working through crontab

A forum for discussing DataStage<sup>®</sup> basics. If you're not sure where your question goes, start here.

Moderators: chulett, rschirm, roy

Post Reply
synsog
Premium Member
Premium Member
Posts: 232
Joined: Sun Aug 01, 2010 11:01 pm
Location: Pune

dsjob not working through crontab

Post by synsog »

Hi,

I am running the following dsjob command through a script -

/opt/ibm/IS/InformationServer/Server/DSEngine/bin/dsjob -domain <dom> -user <usernm> -password <pwd> -server <server> -ljobs <projnm>

And on manually running the script, its giving output but when I am scheduling the script, it is not giving output.

Please give suggestions on this issue.
ppgoml
Participant
Posts: 58
Joined: Mon Aug 20, 2007 11:00 pm

Post by ppgoml »

I think you should redirect output to a file yourself
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

So... by 'crontab' I'm guessing you don't mean the Director client and if so, why not? You need a wrapper script for dsjob to set up the environment properly, it generally won't run well all on its own.
-craig

"You can never have too many knives" -- Logan Nine Fingers
PaulVL
Premium Member
Premium Member
Posts: 1315
Joined: Fri Dec 17, 2010 4:36 pm

Post by PaulVL »

Did you source dsenv before executing the dsjob command?
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

... something that would require a wrapper script to accomplish. :wink:
-craig

"You can never have too many knives" -- Logan Nine Fingers
synsog
Premium Member
Premium Member
Posts: 232
Joined: Sun Aug 01, 2010 11:01 pm
Location: Pune

Post by synsog »

Actually I am directing the output of dsjob to a file.

I am able to do this when I run the script from $ prompt

$ my_script.sh

It works fine

Schedule it thru cron

00 02 * * * /path/to/script/my_script.sh

not working properly.

I am doing this thru unix crontab and not thru datastage director.
PaulVL
Posted: Mon Jan 24, 2011 1:47 pm

--------------------------------------------------------------------------------





Did you source dsenv before executing the dsjob command?
I didnt get you Paul
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

What exactly does your script do... besides run the job, of course.
-craig

"You can never have too many knives" -- Logan Nine Fingers
PaulVL
Premium Member
Premium Member
Posts: 1315
Joined: Fri Dec 17, 2010 4:36 pm

Post by PaulVL »

For /opt/ibm/IS/InformationServer/Server/DSEngine/bin/dsjob to work, you need to source your dsenv file.

Was just asking if you did that in your script before the dsjob was attempted.
synsog
Premium Member
Premium Member
Posts: 232
Joined: Sun Aug 01, 2010 11:01 pm
Location: Pune

Post by synsog »

@Craig : My script makes a list of jobs in a project.

@Paul : No I did not source the dsenv file. I never scheduled a script (having dsjob dssh etc) in cron before so I didnt know about that.
synsog
Premium Member
Premium Member
Posts: 232
Joined: Sun Aug 01, 2010 11:01 pm
Location: Pune

Post by synsog »

Thank you guys... now its working fine :)...

Solution: Sourced the dsenv file from dshome i.e. "/opt/ibm/IS/InformationServer/Server/DSEngine"
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

So... do you understand what that does and why it fixed things for you?
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply