192 |
- |
1 |
#################################################
|
|
|
2 |
# rsnapshot.conf - rsnapshot configuration file #
|
|
|
3 |
#################################################
|
|
|
4 |
# #
|
|
|
5 |
# PLEASE BE AWARE OF THE FOLLOWING RULE: #
|
|
|
6 |
# #
|
|
|
7 |
# This file requires tabs between elements #
|
|
|
8 |
# #
|
|
|
9 |
#################################################
|
|
|
10 |
|
|
|
11 |
#######################
|
|
|
12 |
# CONFIG FILE VERSION #
|
|
|
13 |
#######################
|
|
|
14 |
|
|
|
15 |
config_version 1.2
|
|
|
16 |
|
|
|
17 |
###########################
|
|
|
18 |
# SNAPSHOT ROOT DIRECTORY #
|
|
|
19 |
###########################
|
|
|
20 |
|
|
|
21 |
# All snapshots will be stored under this root directory.
|
|
|
22 |
#
|
|
|
23 |
snapshot_root /data2/homeserver/
|
|
|
24 |
|
|
|
25 |
# If no_create_root is enabled, rsnapshot will not automatically create the
|
|
|
26 |
# snapshot_root directory. This is particularly useful if you are backing
|
|
|
27 |
# up to removable media, such as a FireWire or USB drive.
|
|
|
28 |
#
|
|
|
29 |
#no_create_root 1
|
|
|
30 |
|
|
|
31 |
#################################
|
|
|
32 |
# EXTERNAL PROGRAM DEPENDENCIES #
|
|
|
33 |
#################################
|
|
|
34 |
|
|
|
35 |
# LINUX USERS: Be sure to uncomment "cmd_cp". This gives you extra features.
|
|
|
36 |
# EVERYONE ELSE: Leave "cmd_cp" commented out for compatibility.
|
|
|
37 |
#
|
|
|
38 |
# See the README file or the man page for more details.
|
|
|
39 |
#
|
194 |
- |
40 |
cmd_cp /usr/bin/cp
|
192 |
- |
41 |
|
|
|
42 |
# uncomment this to use the rm program instead of the built-in perl routine.
|
|
|
43 |
#
|
|
|
44 |
cmd_rm /usr/bin/rm
|
|
|
45 |
|
|
|
46 |
# rsync must be enabled for anything to work. This is the only command that
|
|
|
47 |
# must be enabled.
|
|
|
48 |
#
|
194 |
- |
49 |
#cmd_rsync /usr/bin/rsync
|
|
|
50 |
cmd_rsync /usr/local/bin/rsync-no-vanished.sh
|
192 |
- |
51 |
|
|
|
52 |
# Uncomment this to enable remote ssh backups over rsync.
|
|
|
53 |
#
|
|
|
54 |
#cmd_ssh /usr/bin/ssh
|
|
|
55 |
|
|
|
56 |
# Comment this out to disable syslog support.
|
|
|
57 |
#
|
|
|
58 |
cmd_logger /usr/bin/logger
|
|
|
59 |
|
|
|
60 |
# Uncomment this to specify the path to "du" for disk usage checks.
|
|
|
61 |
# If you have an older version of "du", you may also want to check the
|
|
|
62 |
# "du_args" parameter below.
|
|
|
63 |
#
|
|
|
64 |
#cmd_du /usr/bin/du
|
|
|
65 |
|
|
|
66 |
# Uncomment this to specify the path to rsnapshot-diff.
|
|
|
67 |
#
|
|
|
68 |
#cmd_rsnapshot_diff /usr/local/bin/rsnapshot-diff
|
|
|
69 |
|
|
|
70 |
# Specify the path to a script (and any optional arguments) to run right
|
|
|
71 |
# before rsnapshot syncs files
|
|
|
72 |
#
|
|
|
73 |
#cmd_preexec /path/to/preexec/script
|
|
|
74 |
|
|
|
75 |
# Specify the path to a script (and any optional arguments) to run right
|
|
|
76 |
# after rsnapshot syncs files
|
|
|
77 |
#
|
|
|
78 |
#cmd_postexec /path/to/postexec/script
|
|
|
79 |
|
|
|
80 |
# Paths to lvcreate, lvremove, mount and umount commands, for use with
|
|
|
81 |
# Linux LVMs.
|
|
|
82 |
#
|
|
|
83 |
#linux_lvm_cmd_lvcreate /usr/sbin/lvcreate
|
|
|
84 |
#linux_lvm_cmd_lvremove /usr/sbin/lvremove
|
|
|
85 |
#linux_lvm_cmd_mount /usr/bin/mount
|
|
|
86 |
#linux_lvm_cmd_umount /usr/bin/umount
|
|
|
87 |
|
|
|
88 |
#########################################
|
|
|
89 |
# BACKUP LEVELS / INTERVALS #
|
|
|
90 |
# Must be unique and in ascending order #
|
|
|
91 |
# e.g. alpha, beta, gamma, etc. #
|
|
|
92 |
#########################################
|
|
|
93 |
|
|
|
94 |
retain daily 7
|
|
|
95 |
retain weekly 4
|
|
|
96 |
retain monthly 6
|
|
|
97 |
retain yearly 3
|
|
|
98 |
|
|
|
99 |
############################################
|
|
|
100 |
# GLOBAL OPTIONS #
|
|
|
101 |
# All are optional, with sensible defaults #
|
|
|
102 |
############################################
|
|
|
103 |
|
|
|
104 |
# Verbose level, 1 through 5.
|
|
|
105 |
# 1 Quiet Print fatal errors only
|
|
|
106 |
# 2 Default Print errors and warnings only
|
|
|
107 |
# 3 Verbose Show equivalent shell commands being executed
|
|
|
108 |
# 4 Extra Verbose Show extra verbose information
|
|
|
109 |
# 5 Debug mode Everything
|
|
|
110 |
#
|
195 |
- |
111 |
verbose 4
|
192 |
- |
112 |
|
|
|
113 |
# Same as "verbose" above, but controls the amount of data sent to the
|
|
|
114 |
# logfile, if one is being used. The default is 3.
|
|
|
115 |
#
|
|
|
116 |
loglevel 3
|
|
|
117 |
|
|
|
118 |
# If you enable this, data will be written to the file you specify. The
|
|
|
119 |
# amount of data written is controlled by the "loglevel" parameter.
|
|
|
120 |
#
|
194 |
- |
121 |
logfile /var/log/rsnapshot
|
192 |
- |
122 |
|
|
|
123 |
# If enabled, rsnapshot will write a lockfile to prevent two instances
|
|
|
124 |
# from running simultaneously (and messing up the snapshot_root).
|
|
|
125 |
# If you enable this, make sure the lockfile directory is not world
|
|
|
126 |
# writable. Otherwise anyone can prevent the program from running.
|
|
|
127 |
#
|
|
|
128 |
lockfile /var/run/rsnapshot.pid
|
|
|
129 |
|
|
|
130 |
# By default, rsnapshot check lockfile, check if PID is running
|
|
|
131 |
# and if not, consider lockfile as stale, then start
|
|
|
132 |
# Enabling this stop rsnapshot if PID in lockfile is not running
|
|
|
133 |
#
|
|
|
134 |
#stop_on_stale_lockfile 0
|
|
|
135 |
|
|
|
136 |
# Default rsync args. All rsync commands have at least these options set.
|
|
|
137 |
#
|
|
|
138 |
#rsync_short_args -a
|
|
|
139 |
#rsync_long_args --delete --numeric-ids --relative --delete-excluded
|
|
|
140 |
rsync_long_args --stats
|
|
|
141 |
|
|
|
142 |
# ssh has no args passed by default, but you can specify some here.
|
|
|
143 |
#
|
|
|
144 |
#ssh_args -p 22
|
|
|
145 |
|
|
|
146 |
# Default arguments for the "du" program (for disk space reporting).
|
|
|
147 |
# The GNU version of "du" is preferred. See the man page for more details.
|
|
|
148 |
# If your version of "du" doesn't support the -h flag, try -k flag instead.
|
|
|
149 |
#
|
|
|
150 |
#du_args -csh
|
|
|
151 |
|
|
|
152 |
# If this is enabled, rsync won't span filesystem partitions within a
|
|
|
153 |
# backup point. This essentially passes the -x option to rsync.
|
|
|
154 |
# The default is 0 (off).
|
|
|
155 |
#
|
|
|
156 |
#one_fs 0
|
|
|
157 |
|
|
|
158 |
# The include and exclude parameters, if enabled, simply get passed directly
|
|
|
159 |
# to rsync. If you have multiple include/exclude patterns, put each one on a
|
|
|
160 |
# separate line. Please look up the --include and --exclude options in the
|
|
|
161 |
# rsync man page for more details on how to specify file name patterns.
|
|
|
162 |
#
|
|
|
163 |
#include ???
|
|
|
164 |
#include ???
|
|
|
165 |
#exclude ???
|
|
|
166 |
#exclude ???
|
|
|
167 |
exclude spool/*
|
|
|
168 |
exclude virusmails/*
|
|
|
169 |
exclude lib/mysql/*
|
|
|
170 |
exclude lib/php/session/*
|
|
|
171 |
exclude lib/glpi/files/*
|
|
|
172 |
exclude cache/*
|
|
|
173 |
exclude crash/*
|
|
|
174 |
exclude tmp/*
|
|
|
175 |
exclude log/*
|
|
|
176 |
exclude .svn
|
|
|
177 |
exclude src/kernels/*
|
|
|
178 |
exclude temp/*
|
|
|
179 |
exclude rsnapgraph/*
|
194 |
- |
180 |
exclude www/cheapmusic/www/code/discogs/in/*.gz
|
192 |
- |
181 |
|
|
|
182 |
# The include_file and exclude_file parameters, if enabled, simply get
|
|
|
183 |
# passed directly to rsync. Please look up the --include-from and
|
|
|
184 |
# --exclude-from options in the rsync man page for more details.
|
|
|
185 |
#
|
|
|
186 |
#include_file /path/to/include/file
|
|
|
187 |
#exclude_file /path/to/exclude/file
|
|
|
188 |
|
|
|
189 |
# If your version of rsync supports --link-dest, consider enabling this.
|
|
|
190 |
# This is the best way to support special files (FIFOs, etc) cross-platform.
|
|
|
191 |
# The default is 0 (off).
|
|
|
192 |
#
|
|
|
193 |
#link_dest 0
|
|
|
194 |
|
|
|
195 |
# When sync_first is enabled, it changes the default behaviour of rsnapshot.
|
|
|
196 |
# Normally, when rsnapshot is called with its lowest interval
|
|
|
197 |
# (i.e.: "rsnapshot alpha"), it will sync files AND rotate the lowest
|
|
|
198 |
# intervals. With sync_first enabled, "rsnapshot sync" handles the file sync,
|
|
|
199 |
# and all interval calls simply rotate files. See the man page for more
|
|
|
200 |
# details. The default is 0 (off).
|
|
|
201 |
#
|
|
|
202 |
#sync_first 0
|
|
|
203 |
|
|
|
204 |
# If enabled, rsnapshot will move the oldest directory for each interval
|
|
|
205 |
# to [interval_name].delete, then it will remove the lockfile and delete
|
|
|
206 |
# that directory just before it exits. The default is 0 (off).
|
|
|
207 |
#
|
|
|
208 |
#use_lazy_deletes 0
|
|
|
209 |
|
|
|
210 |
# Number of rsync re-tries. If you experience any network problems or
|
|
|
211 |
# network card issues that tend to cause ssh to fail with errors like
|
|
|
212 |
# "Corrupted MAC on input", for example, set this to a non-zero value
|
|
|
213 |
# to have the rsync operation re-tried.
|
|
|
214 |
#
|
|
|
215 |
#rsync_numtries 0
|
|
|
216 |
|
|
|
217 |
# LVM parameters. Used to backup with creating lvm snapshot before backup
|
|
|
218 |
# and removing it after. This should ensure consistency of data in some special
|
|
|
219 |
# cases
|
|
|
220 |
#
|
|
|
221 |
# LVM snapshot(s) size (lvcreate --size option).
|
|
|
222 |
#
|
|
|
223 |
#linux_lvm_snapshotsize 100M
|
|
|
224 |
|
|
|
225 |
# Name to be used when creating the LVM logical volume snapshot(s).
|
|
|
226 |
#
|
|
|
227 |
#linux_lvm_snapshotname rsnapshot
|
|
|
228 |
|
|
|
229 |
# Path to the LVM Volume Groups.
|
|
|
230 |
#
|
|
|
231 |
#linux_lvm_vgpath /dev
|
|
|
232 |
|
|
|
233 |
# Mount point to use to temporarily mount the snapshot(s).
|
|
|
234 |
#
|
|
|
235 |
#linux_lvm_mountpath /path/to/mount/lvm/snapshot/during/backup
|
|
|
236 |
|
|
|
237 |
###############################
|
|
|
238 |
### BACKUP POINTS / SCRIPTS ###
|
|
|
239 |
###############################
|
|
|
240 |
|
|
|
241 |
# LOCALHOST
|
|
|
242 |
backup /boot localhost/boot one_fs=1
|
194 |
- |
243 |
#backup /lib localhost/lib one_fs=1
|
|
|
244 |
#backup /lib64 localhost/lib64 one_fs=1
|
192 |
- |
245 |
#backup /misc localhost/misc one_fs=1
|
|
|
246 |
backup /opt localhost/opt one_fs=1
|
194 |
- |
247 |
#backup /sbin localhost/sbin one_fs=1
|
192 |
- |
248 |
backup /var localhost/var one_fs=1
|
|
|
249 |
backup /dev localhost/dev one_fs=1
|
|
|
250 |
backup /home localhost/home one_fs=1
|
|
|
251 |
#backup /selinux localhost/selinux one_fs=1
|
|
|
252 |
backup /srv localhost/srv one_fs=1
|
194 |
- |
253 |
#backup /bin localhost/bin one_fs=1
|
192 |
- |
254 |
backup /etc localhost/etc one_fs=1
|
194 |
- |
255 |
#backup /media localhost/media one_fs=1
|
192 |
- |
256 |
#backup /net localhost/net one_fs=1
|
|
|
257 |
backup /root localhost/root one_fs=1
|
|
|
258 |
#backup /sys localhost/sys one_fs=1
|
|
|
259 |
backup /usr localhost/usr one_fs=1
|
|
|
260 |
backup /data2/shared localhost/data/shared one_fs=1
|
|
|
261 |
|
|
|
262 |
backup_script /usr/local/bin/backup_mysql.sh dbbackup/
|
|
|
263 |
|
|
|
264 |
#backup /home/ localhost/
|
|
|
265 |
#backup /etc/ localhost/
|
|
|
266 |
#backup /usr/local/ localhost/
|
|
|
267 |
#backup /var/log/rsnapshot localhost/
|
|
|
268 |
#backup /etc/passwd localhost/
|
|
|
269 |
#backup /home/foo/My Documents/ localhost/
|
|
|
270 |
#backup /foo/bar/ localhost/ one_fs=1,rsync_short_args=-urltvpog
|
|
|
271 |
#backup_script /usr/local/bin/backup_pgsql.sh localhost/postgres/
|
|
|
272 |
# You must set linux_lvm_* parameters below before using lvm snapshots
|
|
|
273 |
#backup lvm://vg0/xen-home/ lvm-vg0/xen-home/
|
|
|
274 |
|
|
|
275 |
# EXAMPLE.COM
|
|
|
276 |
#backup_exec /bin/date "+ backup of example.com started at %c"
|
|
|
277 |
#backup root@example.com:/home/ example.com/ +rsync_long_args=--bwlimit=16,exclude=core
|
|
|
278 |
#backup root@example.com:/etc/ example.com/ exclude=mtab,exclude=core
|
|
|
279 |
#backup_exec ssh root@example.com "mysqldump -A > /var/db/dump/mysql.sql"
|
|
|
280 |
#backup root@example.com:/var/db/dump/ example.com/
|
|
|
281 |
#backup_exec /bin/date "+ backup of example.com ended at %c"
|
|
|
282 |
|
|
|
283 |
# CVS.SOURCEFORGE.NET
|
|
|
284 |
#backup_script /usr/local/bin/backup_rsnapshot_cvsroot.sh rsnapshot.cvs.sourceforge.net/
|
|
|
285 |
|
|
|
286 |
# RSYNC.SAMBA.ORG
|
|
|
287 |
#backup rsync://rsync.samba.org/rsyncftp/ rsync.samba.org/rsyncftp/
|