2008-02-14 06:33:01 +08:00
|
|
|
#!/bin/bash
|
|
|
|
#===============================================================================
|
|
|
|
#
|
|
|
|
# FILE: zmdbbackup
|
|
|
|
#
|
|
|
|
# USAGE: ./zmdbbackup
|
|
|
|
#
|
|
|
|
# DESCRIPTION: Uses mysqldump to backup the config info in the zm DB
|
|
|
|
# OPTIONS: --- None
|
|
|
|
# REQUIREMENTS: --- mysqldump
|
|
|
|
# BUGS: ---
|
|
|
|
# NOTES: ---
|
|
|
|
# AUTHOR: Ross Melin <rdmelin@yahoo.com>
|
|
|
|
# COMPANY:
|
|
|
|
# VERSION: 2.0
|
|
|
|
# CREATED: 05/26/2006 06:21:00 AM PDT
|
|
|
|
# REVISION: ---
|
|
|
|
#===============================================================================
|
|
|
|
|
|
|
|
# Edit these to suit your configuration
|
|
|
|
ZM_CONFIG=@ZM_CONFIG@
|
|
|
|
source $ZM_CONFIG
|
2013-11-01 21:47:28 +08:00
|
|
|
# ZM_VERSION in the config is now deprecated but will likely still exist in people's config files. This will override it.
|
|
|
|
ZM_VERSION=@VERSION@
|
2008-02-14 06:33:01 +08:00
|
|
|
|
|
|
|
MYSQLDUMP=/usr/bin/mysqldump
|
|
|
|
BACKUP_PATH=/var/lib/zm
|
|
|
|
BACKUP_FILE=zm_backup.sql
|
|
|
|
DUMPOPTS="--user=$ZM_DB_USER --password=$ZM_DB_PASS --opt"
|
|
|
|
TABLES="Config Filters Groups Monitors States TriggersX10 Users Zones"
|
|
|
|
OUTFILE="$BACKUP_PATH/$BACKUP_FILE"
|
|
|
|
|
|
|
|
echo "--
|
2008-09-30 16:41:23 +08:00
|
|
|
-- Created by zm_db_backup for ZoneMinder Version $ZM_VERSION
|
2008-02-14 06:33:01 +08:00
|
|
|
--" > $OUTFILE
|
|
|
|
|
|
|
|
$MYSQLDUMP $DUMPOPTS zm $TABLES >> $OUTFILE
|
|
|
|
|
|
|
|
exit 0
|