Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 03-15-2012, 09:50 AM   #1
LQ Newbie
Registered: Oct 2008
Posts: 4

Rep: Reputation: 0
service started with crontab uses more cpu?

This seems very strange. On a new install of Debian Squeeze I can execute a shell script directly via command line and the service will take about 30 percent cpu. If I make a crontab execute the script, it takes a LOT more cpu (according to top).

#My crontab entry
* * * * * /home/george/NWN/nwn_restart &> /dev/null

The following is the called script ...

# NWN Server Process Monitor

#Get in the right directory

# Command to run
RESTART="./nwserver -module Earthspur"

#path to pgrep command

# daemon name

# find pid

if [ $? -ne 0 ] # if not running
 # restart 

Once again, I can type ./nwn_restart on the command line and the service uses 30 percent CPU ... if I wait for the crontab to execute the script, top says 152% (on a dual core system)

Thanks for any tips. This is driving me batty.

Last edited by georage; 03-15-2012 at 09:52 AM. Reason: to provide OS info
Old 03-15-2012, 02:25 PM   #2
Registered: Sep 2011
Posts: 163

Rep: Reputation: Disabled
Could it be trying to read stdin?
Old 03-15-2012, 04:41 PM   #3
LQ Newbie
Registered: Oct 2008
Posts: 4

Original Poster
Rep: Reputation: 0


I changed the restart line to use the game server's quiet option, which solved the stdin prob
RESTART="./nwserver -module Earthspur -quiet"


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
[SOLVED] A crontab notification that emails when a job has started, and stopped. bluesword1969 Programming 2 11-17-2011 03:02 PM
Dansguardian - no service to be started ? TechnoBod Linux - Software 1 02-18-2009 04:41 AM
iptables service not started karimasif Linux - Kernel 0 08-31-2007 07:42 AM
LDAP service is not getting started dhanju Linux - Networking 0 01-06-2006 03:36 AM
Telnet service cannot be started! supermyself Linux - Networking 2 06-09-2005 11:46 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:12 PM.

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