forked from ZoneMinder/zoneminder
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathzmdbbackup.in
39 lines (34 loc) · 1.14 KB
/
zmdbbackup.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/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 <[email protected]>
# 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
# 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@
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 "--
-- Created by zm_db_backup for ZoneMinder Version $ZM_VERSION
--" > $OUTFILE
$MYSQLDUMP $DUMPOPTS zm $TABLES >> $OUTFILE
exit 0