Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
crontab :(
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
Rain Designs
Tux's lil' helper
Tux's lil' helper


Joined: 01 Jul 2002
Posts: 130
Location: Los Angeles, CA

PostPosted: Mon Jul 01, 2002 6:03 pm    Post subject: crontab :( Reply with quote

I am running a gaming server as user alex. I have created a shell script that restarts the server if it crashes. So to restart the server, I just do this...
Code:
killall hlds

(hlds is the name of the server) Then the restart script starts the server back up again. I want to set up crontab to kill my server once a month. I tried this..
Code:
* * 1 * * root killall hlds

to kill it the first of the month. It didn't seem to work. Is my code wrong? Thanks for the help in advance!

-Rain
_________________
^M = Death by notepad

http://www.raindesigns.com
Back to top
View user's profile Send private message
Naan Yaar
Bodhisattva
Bodhisattva


Joined: 27 Jun 2002
Posts: 1549

PostPosted: Mon Jul 01, 2002 7:49 pm    Post subject: Re: crontab :( Reply with quote

Are you editing /etc/crontab or a user cron file? The "root" entry is needed only for /etc/crontab. Is /usr/bin on the PATH in crontab?

Rain Designs wrote:
I am running a gaming server as user alex. I have created a shell script that restarts the server if it crashes. So to restart the server, I just do this...
Code:
killall hlds

(hlds is the name of the server) Then the restart script starts the server back up again. I want to set up crontab to kill my server once a month. I tried this..
Code:
* * 1 * * root killall hlds

to kill it the first of the month. It didn't seem to work. Is my code wrong? Thanks for the help in advance!

-Rain
Back to top
View user's profile Send private message
delta407
Bodhisattva
Bodhisattva


Joined: 23 Apr 2002
Posts: 2876
Location: Chicago, IL

PostPosted: Mon Jul 01, 2002 8:17 pm    Post subject: Reply with quote

Also, if it's actually crashed, do killall -9 to kill it forcefully.
Back to top
View user's profile Send private message
Rain Designs
Tux's lil' helper
Tux's lil' helper


Joined: 01 Jul 2002
Posts: 130
Location: Los Angeles, CA

PostPosted: Mon Jul 01, 2002 8:17 pm    Post subject: Reply with quote

I'm not too sure. I logged in as alex and executed "crontab -e" I could look for you but I'm at work, and I don't have acess to SSH at the moment.

I am possitive that
Code:
killall hlds
works, I just need to get it into crontab

Thanks

-Rain
_________________
^M = Death by notepad

http://www.raindesigns.com
Back to top
View user's profile Send private message
delta407
Bodhisattva
Bodhisattva


Joined: 23 Apr 2002
Posts: 2876
Location: Chicago, IL

PostPosted: Mon Jul 01, 2002 8:26 pm    Post subject: Reply with quote

Then make it "* * 1 * * killall hlds" in the user's crontab and you should be good.
Back to top
View user's profile Send private message
Rain Designs
Tux's lil' helper
Tux's lil' helper


Joined: 01 Jul 2002
Posts: 130
Location: Los Angeles, CA

PostPosted: Tue Jul 02, 2002 4:57 pm    Post subject: Reply with quote

thanks :)
_________________
^M = Death by notepad

http://www.raindesigns.com
Back to top
View user's profile Send private message
rizzo
Retired Dev
Retired Dev


Joined: 30 Apr 2002
Posts: 1067
Location: Manitowoc, WI, USA

PostPosted: Tue Jul 02, 2002 5:22 pm    Post subject: Reply with quote

Won't "* * 1 * *" kill the server EVERY MINUTE on the first of the month? I don't think you want to do that. I'd have "0 0 1 * *" or something. Unless I'm mistaken.
Back to top
View user's profile Send private message
delta407
Bodhisattva
Bodhisattva


Joined: 23 Apr 2002
Posts: 2876
Location: Chicago, IL

PostPosted: Tue Jul 02, 2002 5:23 pm    Post subject: Reply with quote

LOL, yeah, you're right.

That'd be funny. :D
_________________
I don't believe in witty sigs.
Back to top
View user's profile Send private message
Rain Designs
Tux's lil' helper
Tux's lil' helper


Joined: 01 Jul 2002
Posts: 130
Location: Los Angeles, CA

PostPosted: Tue Jul 02, 2002 6:19 pm    Post subject: Reply with quote

lol that would really suck. Thanks rizzo.

Code:
0 0 1 * * killall hlds


in the users crontab :D
_________________
^M = Death by notepad

http://www.raindesigns.com
Back to top
View user's profile Send private message
rizzo
Retired Dev
Retired Dev


Joined: 30 Apr 2002
Posts: 1067
Location: Manitowoc, WI, USA

PostPosted: Tue Jul 02, 2002 6:25 pm    Post subject: Reply with quote

No problem. Otherwise I'd hate to be playing half-life on your server on the 1st. Especially since it takes a long time to load the info once you try and join a server. Probably only have 15 seconds of actual game play. Once I'm done buying my flashbangs the game will end. Actually that might be a nice way to disguise my lack of skills.
Back to top
View user's profile Send private message
Rain Designs
Tux's lil' helper
Tux's lil' helper


Joined: 01 Jul 2002
Posts: 130
Location: Los Angeles, CA

PostPosted: Tue Jul 02, 2002 6:39 pm    Post subject: Reply with quote

HAHAHAHAHAHA good stuff!

But believe me, I'm worse than you, lol thats why I became an admin. So when people say I suck, I just kick em!

If your interested, its running cs and when it comes back up, you should connect! 66.12.66.86
_________________
^M = Death by notepad

http://www.raindesigns.com
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum