status check and start

Support and queries relating to all previous versions of ZoneMinder
Locked
jameswilson
Posts: 5111
Joined: Wed Jun 08, 2005 8:07 pm
Location: Midlands UK

status check and start

Post by jameswilson »

i have had my home server change state to stopped. now im not sure if i did it and forgot etc, but can i cron a zm status start if stopped?

James
User avatar
zoneminder
Site Admin
Posts: 5215
Joined: Wed Jul 09, 2003 2:07 pm
Location: Bristol, UK
Contact:

Post by zoneminder »

I'm not sure what you mean by a 'zm status start', can you explain a bit more?

Phil
jameswilson
Posts: 5111
Joined: Wed Jun 08, 2005 8:07 pm
Location: Midlands UK

Post by jameswilson »

ie check the status ir started or stoped
if stoped start it, so if for whatever reason its is currently stopped at say 5am it will start

James
User avatar
rdmelin
Posts: 863
Joined: Wed Oct 29, 2003 2:23 pm
Location: Ellensburg, WA USA

Post by rdmelin »

This should do it, run from cron.

Code: Select all

$!/bin/bash
zmpkg.pl status |grep stopped && zmpkg.pl start
jameswilson
Posts: 5111
Joined: Wed Jun 08, 2005 8:07 pm
Location: Midlands UK

Post by jameswilson »

thanks Ross
User avatar
zoneminder
Site Admin
Posts: 5215
Joined: Wed Jul 09, 2003 2:07 pm
Location: Bristol, UK
Contact:

Post by zoneminder »

I think you can just do an unconditional start anyway, it shouldn't do any harm. Or of course a restart.

One day I'll learn the sequential shell command syntax!

Phil
Locked