Find the answer to your Linux question:
Results 1 to 6 of 6
Hi, I have the following jobs configured to run every 15 minutes 0,15,30,45 * * * * . /home/decimal/sms_engine/OutSmsProcessor.sh 0,15,30,45 * * * * . /home/decimal/sms_engine/InSmsProcessor.sh when i run these ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Oct 2009
    Posts
    6

    Cron Job Issue


    Hi,

    I have the following jobs configured to run every 15 minutes
    0,15,30,45 * * * * . /home/decimal/sms_engine/OutSmsProcessor.sh
    0,15,30,45 * * * * . /home/decimal/sms_engine/InSmsProcessor.sh

    when i run these commands from command line they run fine and processing happens as expected. The cron log shows that these jobs are running fine

    command tail /var/log/cron shows the following

    Oct 29 03:45:01 services crond[7416]: (decimal) CMD (. /home/decimal/sms_engine/InSmsProcessor.sh)
    Oct 29 03:45:01 services crond[7419]: (decimal) CMD (. /home/decimal/sms_engine/OutSmsProcessor.sh)

    In spite of this no processing is being done by the program.

    Could someone please help

    Thanks a ton in advance.

  2. #2
    Linux Newbie
    Join Date
    Jan 2008
    Location
    Canada
    Posts
    109
    Hi mehtalalit
    I notice that there is a decimal and a space prior to your script invocation. The . is unnecesary, but if you do have it it must precede the / with no space between them. Because you are using a complete path the decimal is not necessary. Cheers...
    Robert

  3. #3
    Linux Guru Lakshmipathi's Avatar
    Join Date
    Sep 2006
    Location
    3rd rock from sun - Often seen near moon
    Posts
    1,763
    you are using a complete path the decimal is not necessary.
    Yes,I would agree with Robert.
    If problem persists,check the permission bits of .sh file. - make sure user has appropriate rights and also make sure .sh is an executable file.
    First they ignore you,Then they laugh at you,Then they fight with you,Then you win. - M.K.Gandhi
    -----
    FOSS India Award winning ext3fs Undelete tool www.giis.co.in. Online Linux Terminal http://www.webminal.org

  4. $spacer_open
    $spacer_close
  5. #4
    Just Joined!
    Join Date
    Oct 2009
    Posts
    6
    The permissions on the .sh file are

    -rwxrwxr-x 1 root root 226 Oct 29 23:32 OutSmsProcessor.sh*

    The crontab entry has been configured as

    */15 * * * * /bin/bash /home/decimal/sms_engine/OutSmsProcessor.sh

    I have also tried

    */15 * * * * /bin/sh /home/decimal/sms_engine/OutSmsProcessor.sh

    Nothing seems to be working

    Lalit

  6. #5
    Linux Guru Lakshmipathi's Avatar
    Join Date
    Sep 2006
    Location
    3rd rock from sun - Often seen near moon
    Posts
    1,763
    Is log file still showing same error messages?

    I would suggest you to try a simple script

    #cat simple.sh
    date > /home/lg/log.txt
    just places current time in a file.

    Edit crontab,so that script runs every 2 minutes .
    */2 * * * * lg /bin/bash /home/lg/simple.sh
    After every two minutes , /home/lg/log.txt will have current time.

    Does this work?

    if so ,then there must be some issue your OutSmsProcessor.sh file content.
    First they ignore you,Then they laugh at you,Then they fight with you,Then you win. - M.K.Gandhi
    -----
    FOSS India Award winning ext3fs Undelete tool www.giis.co.in. Online Linux Terminal http://www.webminal.org

  7. #6
    Just Joined!
    Join Date
    Oct 2009
    Posts
    6
    Thank you. It started working. I had to specify complete path for java command i.e /usr/java/jre/bin/java instead of just java

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •