Absurd Minds

More than 100 years without a motto.
It is currently 22 Nov 2024 08:00

All times are UTC-04:00




Post new topic  Reply to topic  [ 4 posts ] 
Author Message
PostPosted: 22 Mar 2012 13:37 
Offline
User avatar

Joined: 25 Mar 2010 19:07
Posts: 8392
I want to write some scripts that will reboot the server machine every week at a certain time.

When the server reboots, I need it to load all the servers in their appropriate screens.

How can I do something like this?

_________________
Server list
Donate


Top
   
PostPosted: 22 Mar 2012 14:17 
Offline
User avatar

Joined: 25 Feb 2012 19:18
Posts: 908
Location: Ontario, Canada
in /etc/crontab

For the server to reboot at 4AM every wednesday (Day of Week 0=Sun, 7= Sat)
00 4 * * 3 root /usr/bin/reboot


To start the servers upon reboot in the same file (/etc/crontab)
@reboot gamer screen -A..... or the path to the shell script



not sure if the script will fail if it doesn't find the screen to kill. Testing needed.

_________________
Image


Top
   
PostPosted: 23 Mar 2012 21:17 
Offline
User avatar

Joined: 25 Mar 2010 19:07
Posts: 8392
Quote:
To start the servers upon reboot in the same file (/etc/crontab)
@reboot gamer screen -A..... or the path to the shell script
So I would need one screen for each of the servers? And thus a seperate line starting with @reboot gamer... for each?

I have a different shell script that calls a kill screen which still works even if the screen doesn't exist, so I think it would work to just write a path to the script.

@reboot gamer /home/gamer/cstrike/pub/pub.sh

_________________
Server list
Donate


Top
   
PostPosted: 23 Mar 2012 21:21 
Offline
User avatar

Joined: 25 Feb 2012 19:18
Posts: 908
Location: Ontario, Canada
yes

_________________
Image


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 4 posts ] 

All times are UTC-04:00


Who is online

Users browsing this forum: No registered users and 2 guests


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 post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Limited