One Star

Schedule Talend job using Linux crontab command

Hi all,
I have 1doubt please anyone resolve it.
I've scheduled my talend job using crontab, but it is not executing?
How could I know if crontab is running?
If I run that job in command prompt(UBUNTU) using

sh filename
the job is running and getting output also.
But when execute using scheduler could not get?
what might be the problem?

Please reply me
Thanks in advance
11 REPLIES
Seventeen Stars

Re: Schedule Talend job using Linux crontab command

hi ,
that could helps you I guess :
http://askubuntu.com/questions/56683/where-is-the-cron-crontab-log
regards
laurent
One Star

Re: Schedule Talend job using Linux crontab command

Thanks for your prompt reply Laurent.
I've already checked up logs as mentioned in that site by using command
grep CRON /var/log/syslog

then I'm getting
(No MTA installed, discarding output)
What could I do now?
Please reply me
Four Stars

Re: Schedule Talend job using Linux crontab command

Hi,
Can you show the crontab line which schedules the job? 
what is the frequency of job execution you set in cron tab, 
whether the path for the job is reachable? 
Whether the user properties for your sh files allow crontab to execute the job?
Vaibhav
Seventeen Stars

Re: Schedule Talend job using Linux crontab command

One Star

Re: Schedule Talend job using Linux crontab command

Thanks for reply vaibav,
*/5 * * * * /home/user/Desktop/SAMPLE/SAMPLE_run.sh
I scheduled for every 5minutes.
And when I'm executing same file using .sh file,it executes and getting output also.
Seventeen Stars

Re: Schedule Talend job using Linux crontab command

Hi Metta,
please take care SAMPLE_run.sh starts with the first line:
#! /bin/bash
Unfortunately Talend usually forget to add this often.
Another nice issue are user right. If you start the job by hand you use your own user. If the job will start from the cron the user is usually root and probably the necessary right are not correct.
Next if you run the job by hand you have your environment variables set. In the cron triggered job this is not the case.
To get the problem it is necessary to improve the error handling and take care all errors will be notified.
Simplest way is using the AMC database. Here you can find all errors and warnings.
Open the project settings and check the attributes in Extras&Logs
One Star

Re: Schedule Talend job using Linux crontab command

Thanks for reply sir,
I didn't understand where to use,    #1 /bin/bash
and what is AMC database.
What should I do if I don't have the right to schedule?
Please explain in detail, what I should do to overcome this problem?
One Star

Re: Schedule Talend job using Linux crontab command

Do couple of things .. can you type ps -ef |grep cron and crontab -l and see the results. Does those commands give you required output or do you see the error as crontab: can't open your crontab file. If you see the 2nd case then it means cron is not installed or enabled.

you can also check the cron process during run time by using the command ps -ef |grep cron 
One Star

Re: Schedule Talend job using Linux crontab command

Thanks for your reply Sunil,
When I'm using crontab -l,I would see the scheduled job as follow,
*/5 * * * * /home/user/Desktop/test_sort/test_sort_run.sh
and when using command ps -ef |grep cron, the result as
user      2587  2586  0 Aug05 pts/5    00:00:00 /bin/sh -c /usr/bin/sensible-editor /tmp/crontab.r22JPM/crontab
user      2588  2587  0 Aug05 pts/5    00:00:00 /bin/sh /usr/bin/sensible-editor /tmp/crontab.r22JPM/crontab
user      2596  2588  0 Aug05 pts/5    00:00:00 /bin/nano /tmp/crontab.r22JPM/crontab
user      2626 29168  0 Aug05 pts/5    00:00:00 crontab -e
user      2627  2626  0 Aug05 pts/5    00:00:00 /bin/sh -c /usr/bin/sensible-editor /tmp/crontab.xkRUuP/crontab
user      2628  2627  0 Aug05 pts/5    00:00:00 /bin/sh /usr/bin/sensible-editor /tmp/crontab.xkRUuP/crontab
user      2636  2628  0 Aug05 pts/5    00:00:00 /bin/nano /tmp/crontab.xkRUuP/crontab
user      5578 29168  0 09:59 pts/5    00:00:00 grep --color=auto cron

What does it mean, whether crontab is running or not...?How should identify?
Seventeen Stars

Re: Schedule Talend job using Linux crontab command

hi,
have a look at : 
http://www.rahul.net/raithel/MyBackPages/crontab.html
regards
laurent
One Star

Re: Schedule Talend job using Linux crontab command

I got output by scheduling as
*/5 * * * * /home/user/Desktop/test_sort/test_sort_run.sh >> /home/user/Desktop/test_sort/test_out.log