Alan Halls · Aug 11, 2010 at 07:01 PM ·
Keep Server Alive with Cron Job
Despite my best efforts, the server still dies sometimes and I am in a random place trying to ssh into the server to restart it on my cell phone after customers start calling.... I tried using google to track down a script that would do the following
Every 5 min execute:
sudo /etc/init.d/WowzaMediaServer status
Then it would grep for "started" and if it isn't found would execute:
sudo /etc/init.d/WowzaMediaServer start
I am not sure how to setup the script + it is going to ask for a password to use the sudo command.
Anybody able to give me a hand? Seems like a nice script that many people should have on hand anyway.
i think it would be better to find why wowza stops and fix that :)
but from memory you could use something like this
create a file called wowza.sh and perhaps put it in /user/local/sbin
# check Wowza
ps -ef | grep -v grep | grep WowzaMediaServer
# if not found - equals to 1, start it
if [ $? -eq 1 ]
echo "eq 0 - wowza running - do nothing"
Zip up conf, logs and bin and send to
firstname.lastname@example.org with a reference to this thread. Are you running Wowza as a system service or are you starting it using ./startup.sh? If ./startup.sh that could explain why it is stopping. The Quick Start guide describes how to start as system service.