Page 1 of 1

dsjob not working through crontab

Posted: Mon Jan 24, 2011 6:49 am
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.

Posted: Mon Jan 24, 2011 7:20 am
by ppgoml
I think you should redirect output to a file yourself

Posted: Mon Jan 24, 2011 7:38 am
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.

Posted: Mon Jan 24, 2011 1:47 pm
by PaulVL
Did you source dsenv before executing the dsjob command?

Posted: Mon Jan 24, 2011 2:38 pm
by chulett
... something that would require a wrapper script to accomplish. :wink:

Posted: Tue Jan 25, 2011 8:01 am
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

Posted: Tue Jan 25, 2011 8:02 am
by chulett
What exactly does your script do... besides run the job, of course.

Posted: Tue Jan 25, 2011 12:37 pm
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.

Posted: Thu Jan 27, 2011 1:10 am
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.

Posted: Thu Jan 27, 2011 4:30 am
by synsog
Thank you guys... now its working fine :)...

Solution: Sourced the dsenv file from dshome i.e. "/opt/ibm/IS/InformationServer/Server/DSEngine"

Posted: Thu Jan 27, 2011 6:37 am
by chulett
So... do you understand what that does and why it fixed things for you?