Hitachi Vantara Pentaho Community Forums
Results 1 to 16 of 16

Thread: problem on scheduling transformation with cron

  1. #1

    Unhappy problem on scheduling transformation with cron

    Hi

    I am getting problem when I schedule transformation with cron on linux.but when I put transformation on command line without cron it works perfectly.

    [root@CVS-Server kettle250]# ./pan.sh -file=test.ktr

    this work perfectlly.The Kettle is installed in root directory named with kettle250.

    But when I want to schedule that transformation to crontab it creates problem. I am putting for eg:-

    15 14 * * * ./root/kettle250/pan.sh -file=test.ktr

    the transformation is not executed. can anybody help me please...


    Thanks
    Nitin

  2. #2
    Join Date
    May 2006
    Posts
    4,882

    Default

    You can't use "./" with the scheduler... use absolute paths. And you need to source in the profile probably to get all environment variables right... explained in a similar thread a couple of days ago.

    Regards,
    Sven

  3. #3

    Unhappy job scheduling

    Hi

    can you please give me an example of absolute path .

    and what type of envoirment varibles you are saying about...?


    help me please...

    I am working from last three days on that but i have no success on that.

    can you help me please...?

    its urgent....

    Thanks
    Nitin

  4. #4
    Join Date
    May 2006
    Posts
    4,882

    Default

    sigh ... UNIX 101

    An absolute path is a path starting with '/', if you start your path with './' it will try to use the current path and you don't know what that will be (usually it's the home directory of the crontab user).

    crontab starts up its jobs with a minimal shell environment, so pan.sh probably won't have all of its environment variables set (where the java runtime is e.g.) and you have to set them either explicitly or possibly by executing the .profile file (if your .profile supports non-interactive logons). So your line will become something like this:

    15 14 * * * (. /absolute_path_1/.profile; /root/kettle250/pan.sh -file=/root/kettle250/test.ktr)

    Where absolute_path_1 is the absolute path to the .profile of your executing user.

    Regards,
    Sven

  5. #5

    Default job schedulng

    Hi sboden

    Thanks for helping me..

    one more thing . can you please tell me where the .profile resides

    I will be very thankfull to u

    thanks
    nitin

  6. #6
    Join Date
    May 2006
    Posts
    4,882

    Default

    Most of the people will take the .profile of the executing user... .profile is in the home directory of the user (it's a hidden file). Alternatively people will make crontab specific "profile scripts".

    Vote for http://jira.pentaho.org/browse/PDI-342 and all of your problems would have been non-existent

    Regards,
    Sven

  7. #7

    Default job scheduling

    thanks sboden

    i am sitting on linux machine.

    I have kettle installed in root directory

    /root/kettle250

    can you tell me what the path for it
    Last edited by nitinsethi; 11-08-2007 at 06:45 AM.

  8. #8
    Join Date
    May 2006
    Posts
    4,882

    Default

    For the path of your profile. Execute in command window:

    cd
    vi .profile (escape :wq to get out)
    pwd

    The directory you get back with pwd is the absolute path to use.

    Regards,
    Sven

  9. #9

    Unhappy job scheduling problem with cron

    Hi sboden

    I type
    cd
    vi .profile
    pwd

    it returns me /root

    Now I am using this path:-
    44 11 * * * (/root/.bash_profile;/root/kettle250/pan.sh -file=test_tr.ktr)

    but i am still getting the problem. the data is not inserted .
    please help me its urgent. I have to complete this work today...

    thanks
    Nitin

  10. #10

    Default job scheduling problem with cron

    Hi sboden

    In command window I type
    cd
    vi .profile
    pwd

    it returns me /root

    Now I am using this path:-
    44 11 * * * (/root/.bash_profile;/root/kettle250/pan.sh -file=test_tr.ktr)

    but i am still getting the problem. the data is not inserted .
    please help me its urgent. I have to complete this work today...

    thanks
    Nitin

  11. #11

    Default problem with scheduling job with cron

    Hi sboden

    In command window I write
    cd
    vi .profile
    pwd

    it returns me /root

    Now I am using this path:-
    44 11 * * * (/root/.bash_profile;/root/kettle250/pan.sh -file=test_tr.ktr)

    but i am still getting the problem. the data is not inserted .
    please help me its urgent. I have to complete this work today...

    thanks
    Nitin

  12. #12
    Join Date
    May 2006
    Posts
    4,882

    Default

    At this point I can only tell you to find the nearest onsite UNIX guy you find and let him have a look.

    1) you're script should be sending out mails to the crontab owner with error messages
    2) for the "-file=test_tr.ktr" you also have to use an absolute path to test_tr.ktr, but I already mentioned that some time ago.

    Regards,
    Sven

  13. #13

    Default job scheduling Problem

    I am already usiing the absolute path

    43 16 * * */root/.bash_profile; /root/kettle250/pan.sh -file=/root/kettle250/test_tr.ktr


    now what the problem in that code

    suggest me..

  14. #14
    Join Date
    Nov 1999
    Posts
    9,729

    Default

    I think that the problem is that cron expects a single command, not a complete script.
    Why don't you create a simple shell script in which you can set all the environment settings needed and launch pan?

    Matt

  15. #15

    Default job scheduling problem

    actually I dont know how to create a shell script file .

    can you give me one example of it.

    and what are the enviorment variables need to set..?

  16. #16

    Wink thanks for helping

    Hi
    Thankyou Mattcasters and sBoden. I have got success in scheduling job through cron.

    Thankyou very much for helping me .

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Privacy Policy | Legal Notices | Safe Harbor Privacy Policy

Copyright © 2005 - 2019 Hitachi Vantara Corporation. All Rights Reserved.