3 |
- |
1 |
#################################################
|
|
|
2 |
# rsnapshot.conf - rsnapshot configuration file #
|
|
|
3 |
#################################################
|
|
|
4 |
# #
|
|
|
5 |
# PLEASE BE AWARE OF THE FOLLOWING RULES: #
|
|
|
6 |
# #
|
|
|
7 |
# This file requires tabs between elements #
|
|
|
8 |
# #
|
|
|
9 |
# Directories require a trailing slash: #
|
|
|
10 |
# right: /home/ #
|
|
|
11 |
# wrong: /home #
|
|
|
12 |
# #
|
|
|
13 |
#################################################
|
|
|
14 |
|
|
|
15 |
#######################
|
|
|
16 |
# CONFIG FILE VERSION #
|
|
|
17 |
#######################
|
|
|
18 |
|
|
|
19 |
config_version 1.2
|
|
|
20 |
|
|
|
21 |
###########################
|
|
|
22 |
# SNAPSHOT ROOT DIRECTORY #
|
|
|
23 |
###########################
|
|
|
24 |
|
|
|
25 |
# All snapshots will be stored under this root directory.
|
|
|
26 |
#
|
|
|
27 |
snapshot_root /linux/
|
|
|
28 |
|
|
|
29 |
# If no_create_root is enabled, rsnapshot will not automatically create the
|
|
|
30 |
# snapshot_root directory. This is particularly useful if you are backing
|
|
|
31 |
# up to removable media, such as a FireWire or USB drive.
|
|
|
32 |
#
|
|
|
33 |
#no_create_root 1
|
|
|
34 |
|
|
|
35 |
#################################
|
|
|
36 |
# EXTERNAL PROGRAM DEPENDENCIES #
|
|
|
37 |
#################################
|
|
|
38 |
|
|
|
39 |
# LINUX USERS: Be sure to uncomment "cmd_cp". This gives you extra features.
|
|
|
40 |
# EVERYONE ELSE: Leave "cmd_cp" commented out for compatibility.
|
|
|
41 |
#
|
|
|
42 |
# See the README file or the man page for more details.
|
|
|
43 |
#
|
|
|
44 |
cmd_cp /bin/cp
|
|
|
45 |
|
|
|
46 |
# uncomment this to use the rm program instead of the built-in perl routine.
|
|
|
47 |
#
|
|
|
48 |
cmd_rm /bin/rm
|
|
|
49 |
|
|
|
50 |
# rsync must be enabled for anything to work. This is the only command that
|
|
|
51 |
# must be enabled.
|
|
|
52 |
#
|
|
|
53 |
cmd_rsync /usr/bin/rsync
|
|
|
54 |
|
|
|
55 |
# Uncomment this to enable remote ssh backups over rsync.
|
|
|
56 |
#
|
|
|
57 |
#cmd_ssh /usr/bin/ssh
|
|
|
58 |
|
|
|
59 |
# Comment this out to disable syslog support.
|
|
|
60 |
#
|
|
|
61 |
cmd_logger /usr/bin/logger
|
|
|
62 |
|
|
|
63 |
# Uncomment this to specify the path to "du" for disk usage checks.
|
|
|
64 |
# If you have an older version of "du", you may also want to check the
|
|
|
65 |
# "du_args" parameter below.
|
|
|
66 |
#
|
|
|
67 |
cmd_du /usr/bin/du
|
|
|
68 |
|
|
|
69 |
# Uncomment this to specify the path to rsnapshot-diff.
|
|
|
70 |
#
|
|
|
71 |
cmd_rsnapshot_diff /usr/bin/rsnapshot-diff
|
|
|
72 |
|
|
|
73 |
# Specify the path to a script (and any optional arguments) to run right
|
|
|
74 |
# before rsnapshot syncs files
|
|
|
75 |
#
|
|
|
76 |
#cmd_preexec /path/to/preexec/script
|
|
|
77 |
|
|
|
78 |
# Specify the path to a script (and any optional arguments) to run right
|
|
|
79 |
# after rsnapshot syncs files
|
|
|
80 |
#
|
|
|
81 |
#cmd_postexec /path/to/postexec/script
|
|
|
82 |
|
|
|
83 |
#########################################
|
|
|
84 |
# BACKUP INTERVALS #
|
|
|
85 |
# Must be unique and in ascending order #
|
|
|
86 |
# i.e. hourly, daily, weekly, etc. #
|
|
|
87 |
#########################################
|
|
|
88 |
|
|
|
89 |
#interval hourly 3
|
|
|
90 |
interval daily 7
|
|
|
91 |
interval weekly 4
|
|
|
92 |
interval monthly 6
|
|
|
93 |
|
|
|
94 |
############################################
|
|
|
95 |
# GLOBAL OPTIONS #
|
|
|
96 |
# All are optional, with sensible defaults #
|
|
|
97 |
############################################
|
|
|
98 |
|
|
|
99 |
# Verbose level, 1 through 5.
|
|
|
100 |
# 1 Quiet Print fatal errors only
|
|
|
101 |
# 2 Default Print errors and warnings only
|
|
|
102 |
# 3 Verbose Show equivalent shell commands being executed
|
|
|
103 |
# 4 Extra Verbose Show extra verbose information
|
|
|
104 |
# 5 Debug mode Everything
|
|
|
105 |
#
|
|
|
106 |
verbose 3
|
|
|
107 |
|
|
|
108 |
# Same as "verbose" above, but controls the amount of data sent to the
|
|
|
109 |
# logfile, if one is being used. The default is 3.
|
|
|
110 |
#
|
|
|
111 |
loglevel 3
|
|
|
112 |
|
|
|
113 |
# If you enable this, data will be written to the file you specify. The
|
|
|
114 |
# amount of data written is controlled by the "loglevel" parameter.
|
|
|
115 |
#
|
|
|
116 |
logfile /var/log/rsnapshot
|
|
|
117 |
|
|
|
118 |
# If enabled, rsnapshot will write a lockfile to prevent two instances
|
|
|
119 |
# from running simultaneously (and messing up the snapshot_root).
|
|
|
120 |
# If you enable this, make sure the lockfile directory is not world
|
|
|
121 |
# writable. Otherwise anyone can prevent the program from running.
|
|
|
122 |
#
|
|
|
123 |
lockfile /var/run/rsnapshot.pid
|
|
|
124 |
|
|
|
125 |
# Default rsync args. All rsync commands have at least these options set.
|
|
|
126 |
#
|
|
|
127 |
#rsync_short_args -a
|
|
|
128 |
#rsync_long_args --delete --numeric-ids --relative --delete-excluded
|
|
|
129 |
rsync_long_args --stats
|
|
|
130 |
|
|
|
131 |
# ssh has no args passed by default, but you can specify some here.
|
|
|
132 |
#
|
|
|
133 |
#ssh_args -p 22
|
|
|
134 |
|
|
|
135 |
# Default arguments for the "du" program (for disk space reporting).
|
|
|
136 |
# The GNU version of "du" is preferred. See the man page for more details.
|
|
|
137 |
# If your version of "du" doesn't support the -h flag, try -k flag instead.
|
|
|
138 |
#
|
|
|
139 |
#du_args -csh
|
|
|
140 |
|
|
|
141 |
# If this is enabled, rsync won't span filesystem partitions within a
|
|
|
142 |
# backup point. This essentially passes the -x option to rsync.
|
|
|
143 |
# The default is 0 (off).
|
|
|
144 |
#
|
|
|
145 |
#one_fs 1
|
|
|
146 |
|
|
|
147 |
# The include and exclude parameters, if enabled, simply get passed directly
|
|
|
148 |
# to rsync. If you have multiple include/exclude patterns, put each one on a
|
|
|
149 |
# separate line. Please look up the --include and --exclude options in the
|
|
|
150 |
# rsync man page for more details on how to specify file name patterns.
|
|
|
151 |
#
|
|
|
152 |
#include ???
|
|
|
153 |
#include ???
|
|
|
154 |
#exclude ???
|
|
|
155 |
#exclude ???
|
|
|
156 |
exclude src/kernels/*
|
|
|
157 |
exclude spool/mqueue/*
|
|
|
158 |
exclude cache/*
|
|
|
159 |
exclude .svn
|
|
|
160 |
|
|
|
161 |
# The include_file and exclude_file parameters, if enabled, simply get
|
|
|
162 |
# passed directly to rsync. Please look up the --include-from and
|
|
|
163 |
# --exclude-from options in the rsync man page for more details.
|
|
|
164 |
#
|
|
|
165 |
#include_file /path/to/include/file
|
|
|
166 |
#exclude_file /path/to/exclude/file
|
|
|
167 |
|
|
|
168 |
# If your version of rsync supports --link-dest, consider enable this.
|
|
|
169 |
# This is the best way to support special files (FIFOs, etc) cross-platform.
|
|
|
170 |
# The default is 0 (off).
|
|
|
171 |
#
|
|
|
172 |
link_dest 0
|
|
|
173 |
|
|
|
174 |
# When sync_first is enabled, it changes the default behaviour of rsnapshot.
|
|
|
175 |
# Normally, when rsnapshot is called with its lowest interval
|
|
|
176 |
# (i.e.: "rsnapshot hourly"), it will sync files AND rotate the lowest
|
|
|
177 |
# intervals. With sync_first enabled, "rsnapshot sync" handles the file sync,
|
|
|
178 |
# and all interval calls simply rotate files. See the man page for more
|
|
|
179 |
# details. The default is 0 (off).
|
|
|
180 |
#
|
|
|
181 |
sync_first 0
|
|
|
182 |
|
|
|
183 |
# If enabled, rsnapshot will move the oldest directory for each interval
|
|
|
184 |
# to [interval_name].delete, then it will remove the lockfile and delete
|
|
|
185 |
# that directory just before it exits. The default is 0 (off).
|
|
|
186 |
#
|
|
|
187 |
use_lazy_deletes 0
|
|
|
188 |
|
|
|
189 |
###############################
|
|
|
190 |
### BACKUP POINTS / SCRIPTS ###
|
|
|
191 |
###############################
|
|
|
192 |
|
|
|
193 |
# LOCALHOST
|
|
|
194 |
backup /bin localhost/bin one_fs=1
|
|
|
195 |
backup /dev localhost/dev one_fs=1
|
|
|
196 |
backup /home localhost/home one_fs=1
|
|
|
197 |
backup /opt localhost/opt one_fs=1
|
|
|
198 |
backup /root localhost/root one_fs=1
|
|
|
199 |
backup /selinux localhost/selinux one_fs=1
|
|
|
200 |
backup /usr localhost/usr one_fs=1
|
|
|
201 |
backup /boot localhost/boot one_fs=1
|
|
|
202 |
backup /etc localhost/etc one_fs=1
|
|
|
203 |
backup /lib localhost/lib one_fs=1
|
|
|
204 |
backup /misc localhost/misc one_fs=1
|
|
|
205 |
backup /net localhost/net one_fs=1
|
|
|
206 |
backup /sbin localhost/sbin one_fs=1
|
|
|
207 |
backup /srv localhost/srv one_fs=1
|
|
|
208 |
backup /var localhost/var one_fs=1
|
|
|
209 |
#backup /home/ localhost/
|
|
|
210 |
#backup /etc/ localhost/
|
|
|
211 |
#backup /usr/local/ localhost/
|
|
|
212 |
#backup /var/log/rsnapshot localhost/
|
|
|
213 |
#backup /etc/passwd localhost/
|
|
|
214 |
#backup /home/foo/My Documents/ localhost/
|
|
|
215 |
#backup /foo/bar/ localhost/ one_fs=1, rsync_short_args=-urltvpog
|
|
|
216 |
#backup_script /usr/local/bin/backup_pgsql.sh localhost/postgres/
|
|
|
217 |
|
|
|
218 |
# EXAMPLE.COM
|
|
|
219 |
#backup_script /bin/date "+ backup of example.com started at %c" unused1
|
|
|
220 |
#backup root@example.com:/home/ example.com/ +rsync_long_args=--bwlimit=16,exclude=core
|
|
|
221 |
#backup root@example.com:/etc/ example.com/ exclude=mtab,exclude=core
|
|
|
222 |
#backup_script ssh root@example.com "mysqldump -A > /var/db/dump/mysql.sql"
|
|
|
223 |
#backup root@example.com:/var/db/dump/ example.com/
|
|
|
224 |
#backup_script /bin/date "+ backup of example.com ended at %c" unused2
|
|
|
225 |
|
|
|
226 |
# CVS.SOURCEFORGE.NET
|
|
|
227 |
#backup_script /usr/local/bin/backup_rsnapshot_cvsroot.sh rsnapshot.cvs.sourceforge.net/
|
|
|
228 |
|
|
|
229 |
# RSYNC.SAMBA.ORG
|
|
|
230 |
#backup rsync://rsync.samba.org/rsyncftp/ rsync.samba.org/rsyncftp/
|