Welcome to Linux Forums! With a comprehensive Linux Forum, information on various types of Linux software and many Linux Reviews articles, we have all the knowledge you need a click away, or accessible via our knowledgeable members.
Find the answer to your Linux question:
New to Linux Forums? Register here for free!
    Linux Forums > GNU Linux Zone > Servers > Cron Job Issue

Forgot Password?
 Servers   Anything server related, Apache, MySQL, Samba, server security, sendmail, exim, etc

Site Navigation
Linux Articles
Linux Forums
Linux Downloads
Linux Hosting
Free Magazines
Job Board
IRC Chat
RSS Feeds


Linux Forum Topics
Linux Forums
Your Distro
Linux Resources
GNU Linux Zone
The Community
Reply
 
Thread Tools Display Modes
Old 3 Weeks Ago   #1 (permalink)
Just Joined!
 
Join Date: Oct 2009
Posts: 3
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.
mehtalalit is offline  


Reply With Quote
Old 3 Weeks Ago   #2 (permalink)
Linux Newbie
 
Join Date: Jan 2008
Location: Canada
Posts: 102
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
robertdaleweir is offline   Reply With Quote
Old 3 Weeks Ago   #3 (permalink)
Linux Engineer
 
Lakshmipathi's Avatar
 
Join Date: Sep 2006
Location: 3rd rock from sun
Posts: 1,093
Quote:
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.
__________________
- Lakshmipathi.G
-------------------
FOSS India Award winning ext3fs Undelete tool and tutorials www.giis.co.in
First they criticize you,Then they laugh at you,Then they fight with you,Then you win. - M.K.Gandhi
-------------------
Lakshmipathi is offline   Reply With Quote
Old 3 Weeks Ago   #4 (permalink)
Just Joined!
 
Join Date: Oct 2009
Posts: 3
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
mehtalalit is offline   Reply With Quote
Old 3 Weeks Ago   #5 (permalink)
Linux Engineer
 
Lakshmipathi's Avatar
 
Join Date: Sep 2006
Location: 3rd rock from sun
Posts: 1,093
Is log file still showing same error messages?

I would suggest you to try a simple script

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

Edit crontab,so that script runs every 2 minutes .
Quote:
*/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.
__________________
- Lakshmipathi.G
-------------------
FOSS India Award winning ext3fs Undelete tool and tutorials www.giis.co.in
First they criticize you,Then they laugh at you,Then they fight with you,Then you win. - M.K.Gandhi
-------------------
Lakshmipathi is offline   Reply With Quote
Old 3 Weeks Ago   #6 (permalink)
Just Joined!
 
Join Date: Oct 2009
Posts: 3
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
mehtalalit is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Free Magazines
Run Your Own Web Server Using Linux & Apache - Free 191 Page Preview
Learn about everything you'll need to build and maintain your Linux servers, and to deploy Web applications to them.
subscribe
Open Source Security Myths Dispelled
Dispel the five major myths surrounding Open Source Security and gain the tools necessary to make a truly informed decision for your IT organization
subscribe
InformationWeek
InformationWeek is the only newsweekly you'll need to stay on top of the latest developments in information technology.
subscribe



All times are GMT. The time now is 05:47 PM.






© 2000 - 2009 - All Rights Reserved - Property of  MAS Media

Content Relevant URLs by vBSEO 3.3.0 RC2