restart script

0 views
Skip to first unread message

johnny

unread,
Dec 21, 2009, 4:37:46 PM12/21/09
to moo-...@googlegroups.com
Hi i was wondering if anyone might be able to give me a little advice on how to create a script that would restart the server if it was to crash? I would not be sure where ot start on that one. Thanks.
Come join us on argon
107thezone.com
port 9350
Play a game with lots of fun.

Stephen Gigante

unread,
Dec 21, 2009, 11:55:47 PM12/21/09
to moo-talk
The simplest way is to create a loop in your start batch, although if the server is panicing for a reason, that will mean it just keep rebooting every time it loads.

If you have spare resources, you could try booting the server every couple hours via a cron.  If the server is running, it will load the MOO, announce "Port 7777 is already in use", and shut down.

I had a method set up where the MOO would use FUP (I prefer it over FileIO) to write a running file.  The machine had a cron set up that would check for the existence of that file, and if it is there, simply delete it, and if it isn't there, boot the server.

I suppose that you could try doing similar by checking if the port is open, rather than using a file, but I don't know how to do that. Could anyone give an explanation on that method?

Stephen

--

You received this message because you are subscribed to the Google Groups "MOO Talk" group.
To post to this group, send email to MOO-...@googlegroups.com.
To unsubscribe from this group, send email to MOO-talk+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/MOO-talk?hl=en.

michael munson

unread,
Dec 22, 2009, 1:10:20 AM12/22/09
to moo-...@googlegroups.com
Write a bash script then put it in cron. 2 different ways to do this:

1) Look using PS if the moo process with your database name is already running, if it is then restart the MOO.
2) Use netcat to see if the port your MOO is using is open, if it is NOT then restart the MOO.

Tristan B

unread,
Dec 22, 2009, 3:15:53 PM12/22/09
to moo-...@googlegroups.com
This might go in with something I've been wondering. How could I make a cron or crontab script to back up the moo db to a folder on the server. Then every 12 hours it could whipe that back up folder and start over, so it would have 12 hours of backups back-to-back.
 
 
Any ideas?
 
--
 
Tristan B
 
TrekGames.net
 
Administrator and Maintainer
 
Contact information:
Skype: Tristanbussiere
MSN: tri...@acegamesonline.net
follow me on twitter
http://twitter.com/blindtrek/
 
 
or
email TrekGames.net support
trek...@gmail.com
 
AOL Instant Messenger: Theblinddj360
 
Klango ID:
Tristan
 
Connect to cosmos and join the fun. Point your MUD client to the following address and port:
Address: TrekGames.net
Port: 1234

Tyler Littlefield

unread,
Dec 22, 2009, 4:08:06 PM12/22/09
to moo-...@googlegroups.com
just set the hour to 0 and 12 and make it do something like tar -cjvf db.tar.bz2 db.db you could even add in the date and that relatively easy.
I had a method set up where the MOO would use FUP (I prefer it over FileIO) to write arunning file.  The machine had a cron set up that would check for the existence of that file, and if it is there, simply delete it, and if it isn't there, boot the server.

Tim van Dijen

unread,
Dec 23, 2009, 1:07:48 AM12/23/09
to moo-...@googlegroups.com
Op 22-12-2009 21:15, Tristan B schreef:
This might go in with something I've been wondering. How could I make a cron or crontab script to back up the moo db to a folder on the server. Then every 12 hours it could whipe that back up folder and start over, so it would have 12 hours of backups back-to-back.
 
 
Any ideas?
 
--
 
Tristan B
 


You could use FUP / File I/O for that as well...

Goblin

michael munson

unread,
Dec 23, 2009, 7:21:24 AM12/23/09
to moo-...@googlegroups.com
You could put a bash script in crontab every 12 hours something like this:

mv moo_backup4.db moo_backup5.db
mv moo_backup3.db moo_backup4.db
mv moo_backup2.db moo_backup3.db
mv moo_backup1.db moo_backup2.db
cp moo.db.new moo_backup1.db

That will give you 5 backups.

Stephen Gigante

unread,
Dec 23, 2009, 7:58:59 PM12/23/09
to moo-...@googlegroups.com
mv moo.db moo.`date +%H`.db

That'll rename it to moo.00.db through to moo.23.db

-Stephen
Reply all
Reply to author
Forward
0 new messages