To use this, create a filter for events you would like to "insure" with this, and save it, selecting the "Automatically execute command on all matches:" option. Use the full path to wherever you save the script.
Note: I believe only one "execute command" filter can be run on any event.
I will post a recovery utility to use with this shortly
Code: Select all
#!/bin/bash
#===============================================================================
#
# FILE: zmeventdump
#
# USAGE: ./zmeventdump <MonitorName>/<EventId>
#
# DESCRIPTION: Uses mysqldump to create a .sql file for individual zm
# events to make Event table recovery possible by doing a
# 'find' search in ZoneMinder the events directory
#
# OPTIONS: --- None
# REQUIREMENTS: --- mysqldump
# BUGS: ---
# NOTES: ---
# AUTHOR: Ross Melin <rdmelin@yahoo.com>
# COMPANY:
# VERSION: 1.0
# CREATED: 05/20/2006 06:14:59 PM PDT
# REVISION: ---
#===============================================================================
# Edit these to suit your configuration
ZM_CONFIG=/etc/zm.conf
EVENTS_DIR=/var/www/html/zm/events
# The rest should not need editing
EVENT_PATH=$1
EVENT_ID=$(echo $1 |cut -f 2 -d / )
# Get the mysql user and password
source $ZM_CONFIG
# Dump the sql statements needed to reload the Events table
/usr/bin/mysqldump \
--user=$ZM_DB_USER \
--password=$ZM_DB_PASS \
--skip-opt \
--compact \
--quick \
--no-create-info \
--where="Id=$EVENT_ID" \
zm Events > \
$EVENTS_DIR/$EVENT_PATH/.sql
exit 0