LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > SUSE / openSUSE
User Name
Password
SUSE / openSUSE This Forum is for the discussion of Suse Linux.

Notices


Reply
  Search this Thread
Old 11-20-2009, 02:10 PM   #1
SUSE-OES
LQ Newbie
 
Registered: Mar 2009
Posts: 5

Rep: Reputation: 0
CRON job runs, but doesn't perform the task


This is on Suse (SLES10sp2)

I logged in as root and created a cron job to restart a service every 5 minutes:

*/5 * * * * rc(servicename) restart <parameters>

if I turn on logging by adding this line, I see the log file being created and an entry appended every minute, but the service never restarts:

* * * * * date >> /tmp/cron_test.txt

What am I missing??

Thx

DG
 
Old 11-20-2009, 02:52 PM   #2
anomie
Senior Member
 
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora
Posts: 3,935
Blog Entries: 5

Rep: Reputation: Disabled
IIRC, suse uses rc<service> to somehow alias to /etc/init.d/<service>.

Just use the fully qualified path in your cronjob.

---

P.S. What service are you restarting every 5 minutes..?
 
Old 11-20-2009, 03:30 PM   #3
SUSE-OES
LQ Newbie
 
Registered: Mar 2009
Posts: 5

Original Poster
Rep: Reputation: 0
Doh! Thanks, that did it. I'm (obviously) new to Linux, moving there from another platform. The service being restarted is a web font-end for Tomcat-- we are doing some testing and it's easier to have it restart itself when we break it....
:^)

Thanks!

DG
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Cron Job only runs when it is manually started sinister1 Linux - General 4 02-25-2008 08:35 AM
cron job runs but will not write to logfile c_curtis Linux - General 10 06-30-2006 09:25 AM
Cron Job Syntax for a task in seconds AJones Linux - Software 2 07-22-2005 12:56 PM
cron job only runs halfway aunquarra Linux - General 15 01-31-2005 04:53 PM
Why Does One Cron Job Runs Twice? cpope67 Programming 4 11-16-2004 06:09 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > SUSE / openSUSE

All times are GMT -5. The time now is 01:43 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration