-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmakebackup.conf
200 lines (186 loc) · 12.2 KB
/
makebackup.conf
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
#------------------------------------------------------------------------------#
# vi: set sw=4 ts=4 ai: ("set modeline" in ~/.exrc) #
#------------------------------------------------------------------------------#
# Config file : makebackup.conf #
# #
# Author : Ton Kersten Groesbeek, The Netherlands #
# #
# Description : Configuration file for 'makebackup' #
#------------------------------------------------------------------------------#
#------------------------------------------------------------------------------#
# V e r s i o n i n f o r m a t i o n #
#------------------------------------------------------------------------------#
# $Id:: makebackup.conf 15 2013-08-07 11:09:19 tonk $: #
# $Revision:: 15 $: #
# $Author:: Ton Kersten <[email protected]> $: #
# $Date:: 2013-08-07 11:09:29 +0200 (Wed, 07 Aug 2013) $: #
#------------------------------------------------------------------------------#
# E n d o f v e r s i o n i n f o r m a t i o n #
#------------------------------------------------------------------------------#
#------------------------------------------------------------------------------#
# Maximum number of cycles to keep (This is the default for all destinations) #
# It's also possible to define a number of cycles per backup set (CYCL[$BCKS]) #
#------------------------------------------------------------------------------#
MAX="14"
#------------------------------------------------------------------------------#
# Create MySQL backups? (You need the 'mysqlbackup' program for this to work) #
# You need the 'mysqlbackup' program for this to work and you can get this at #
# http://tonkersten.com #
#------------------------------------------------------------------------------#
BACKUPMYSQL="yes"
#------------------------------------------------------------------------------#
# Set debugging options (DEBUG=1 switches on 'set -x' in the script) #
#------------------------------------------------------------------------------#
VERBOSE=1
DEBUG=0
#------------------------------------------------------------------------------#
# Set syslog and facility (Optional. If SYSLOG=0, no extra syslog output) #
#------------------------------------------------------------------------------#
SYSLOG=1
SYSLOGFAC="local4.info"
#------------------------------------------------------------------------------#
# Create monthly backups? #
#------------------------------------------------------------------------------#
MONTHLY="yes"
MONTHLYMAX="36"
#------------------------------------------------------------------------------#
# Add extra options to the rsync command. #
# Normally '-aRqx --delete -e ssh' is used. #
#------------------------------------------------------------------------------#
RSYNCOPTS="HA"
#------------------------------------------------------------------------------#
# Define who gets the ouput with the logging #
# #
# Notify can be: #
# - syslog -> All logging goes to syslog #
# - mail -> All logging goes to email address in MAILTO #
# - mail-failonly -> All logging goes to email address in MAILTO #
# only in case of failure #
# - none -> No logging kept #
# - stdout -> Default / Not matching any of the above #
# #
# Mailto: #
# - A standard email address #
#------------------------------------------------------------------------------#
NOTIFY="mail-failonly"
MAILTO="root@localhost"
#------------------------------------------------------------------------------#
# Define a pre and post backup command (e.g. Mount or umount a disk) #
#------------------------------------------------------------------------------#
PREBACKUP=""
POSTBACKUP=""
#------------------------------------------------------------------------------#
# Define what to backup and where to put it. #
# Standard Bash syntax is needed here and the variables used are: #
# #
# BCKS -> The number of backup sets (increase by one per set) #
# DESC[i] -> The description for this backup set #
# SHRT[i] -> Short description for this backup set (Used with syslog) #
# CYCL[i] -> The number of backup cycles to keep (optional, default $MAX) #
# DSTS[i] -> The destination for this backup set. Multiple dests are allowed #
# DIRS[i] -> Directories to backup. Multiple dirs are allowed #
# EXCL[i] -> "Things" to exclude. See also: man rsync #
# REMOVE[i] -> When set to "REMOVE_OBSOLETE_BACKUP" DSTS[i] will be removed #
# #
# The index 'i' is the 'set index' and is the value of 'BCKS' #
# Example: DESC[${BCKS}]="Filesystem backup for server data" #
# #
#------------------------------------------------------------------------------#
# #
# For remote server backup SSH key access is needed for user user root. #
# Place the option #
# PermitRootLogin forced-commands-only #
# in the file 'sshd_config' #
# #
# And put the ssh-key in '/root/.ssh/authorized_keys' starting with: #
# from="BackupServerIP",command="/usr/local/bin/check_command" #
# (replace 'BackupServerIP' with the IP address of the backup server.) #
# #
# The command 'check_command' checks if the requested command is a 'rsync' #
# command and acts accordingly. #
# This is a very simple script, containing" #
# #
# #!/bin/bash #
# case "${SSH_ORIGINAL_COMMAND}" #
# in #
# *\&*) #
# echo "Rejected" #
# ;; #
# *\(*) #
# echo "Rejected" #
# ;; #
# *\{*) #
# echo "Rejected" #
# ;; #
# *\;*) #
# echo "Rejected" #
# ;; #
# *\<*) #
# echo "Rejected" #
# ;; #
# *\`*) #
# echo "Rejected" #
# ;; #
# *\|*) #
# echo "Rejected" #
# ;; #
# rsync\ --server*) #
# ${SSH_ORIGINAL_COMMAND} #
# ;; #
# *) #
# echo "Rejected" #
# ;; #
# esac #
# #
#------------------------------------------------------------------------------#
#------------------------------------------------------------------------------#
# Define the prutser directories #
#------------------------------------------------------------------------------#
BCKS=${BCKS}+1
DESC[${BCKS}]="Filesystem backup for server prutser"
SHRT[${BCKS}]="prutser"
DSTS[${BCKS}]=""
DSTS[${BCKS}]="${DSTS[${BCKS}]} /backup/backups/prutser"
DIRS[${BCKS}]=""
DIRS[${BCKS}]="${DIRS[${BCKS}]} 192.168.63.4:/root"
DIRS[${BCKS}]="${DIRS[${BCKS}]} 192.168.63.4:/etc"
DIRS[${BCKS}]="${DIRS[${BCKS}]} 192.168.63.4:/var/named"
EXCL[${BCKS}]=""
EXCL[${BCKS}]="${EXCL[${BCKS}]} *~"
EXCL[${BCKS}]="${EXCL[${BCKS}]} *.bak"
#------------------------------------------------------------------------------#
# Define the localhost directories #
#------------------------------------------------------------------------------#
BCKS=${BCKS}+1
DESC[${BCKS}]="Filesystem backup for server vmware"
SHRT[${BCKS}]="vmware"
DSTS[${BCKS}]=""
DSTS[${BCKS}]="${DSTS[${BCKS}]} /backup/backups/vmware"
DIRS[${BCKS}]=""
DIRS[${BCKS}]="${DIRS[${BCKS}]} /root"
DIRS[${BCKS}]="${DIRS[${BCKS}]} /etc"
DIRS[${BCKS}]="${DIRS[${BCKS}]} /home"
DIRS[${BCKS}]="${DIRS[${BCKS}]} /data/share"
#------------------------------------------------------------------------------#
# And to the external disk #
#------------------------------------------------------------------------------#
BCKS=${BCKS}+1
CYCL[${BCKS}]="31" # Keep more cycles for this backup #
DESC[${BCKS}]="Filesystem backup for server vmware to kliko"
SHRT[${BCKS}]="vmware to kliko"
DSTS[${BCKS}]=""
DSTS[${BCKS}]="${DSTS[${BCKS}]} /media/kliko/backups/vmware"
DIRS[${BCKS}]=""
DIRS[${BCKS}]="${DIRS[${BCKS}]} /root"
DIRS[${BCKS}]="${DIRS[${BCKS}]} /etc"
DIRS[${BCKS}]="${DIRS[${BCKS}]} /home"
DIRS[${BCKS}]="${DIRS[${BCKS}]} /data/share"
#------------------------------------------------------------------------------#
# Another way to do it: #
# Include all configs in the 'conf' directory #
#------------------------------------------------------------------------------#
## for conf in ${CRD}/conf/*.conf
## do
## echo " Including config file ${conf}"
## . ${conf}
## done