-
Notifications
You must be signed in to change notification settings - Fork 1
/
README
227 lines (174 loc) · 8.71 KB
/
README
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
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
_____ _ _ _
| ___| | _____ _| |__ __ _ ___| | ___ _ _ __
| |_ | |/ _ \ \/ / '_ \ / _` |/ __| |/ / | | | '_ \
| _| | | __/> <| |_) | (_| | (__| <| |_| | |_) |
|_| |_|\___/_/\_\_.__/ \__,_|\___|_|\_\\__,_| .__/
|_|
http://www.flexbackup.org
----------------------------------------------------------------------
A flexible backup tool
Features:
o Easy to configure
o Uses dump, afio, GNU tar, cpio, star, pax, or zip archivers
o Full and numbered levels of incremental backup (acts like "dump")
o Compression and buffering options for all backup types
o Does remote filesystems (over rsh/ssh; no special service)
o Package delta mode can backup files not owned by rpm, or owned+changed files.
o Writes to tapes, on-disk archive files, or on-disk directory trees
o Keeps a table of contents so you know what archives are on each tape
o Nice log files
Software needed:
o perl
o fileutils, findutils (a "find" capable of using the -regex switch)
o one or more of
dump/restore, afio, GNU tar, star, pax, cpio, zip
o mt (if using tapes)
o gzip, bzip2, lzop, or compress (optional)
o buffer (optional) [needs patches or recompile for 2+GB file support]
See the INSTALL file for installation instructions.
I looked at many other packages and didn't really find anything that
worked the way I wanted it to. For my needs I felt the existing
packages were any combination of:
o Too complex to setup/use
o Lacked documentation
o Nonstandard archiving formats
o Overkill for a small network of 2 or 3 machines
o Too simplistic, or hard-coded assumptions
o No scripts helped drive "dump/restore"
o Didn't have features I wanted
I also wanted to take the standard backup tools and make a generic
interface to them.
----------------------------------------------------------------------
USAGE EXAMPLES
--> Please see "flexbackup -help" and the config file comments, or the
flexbackup(1) and flexbackup.conf(5) manpages. There are many useful
options that aren't appropriate to describe here.
To do a full backup of /home:
flexbackup -dir /home
For nightly incremental backups, run something like this via cron:
flexbackup -set all -level 9
To do a full backup of /usr from machine "otherhost", forcing cpio type:
flexbackup -dir otherhost:/usr -type cpio
To do an level 5 incremental backup of a named backup set:
flexbackup -set backupset2 -level 5
Extract all files from file number 1 on the tape into current directory:
flexbackup -extract -num 1
Compare afio archive at current tape position with the current
directory:
flexbackup -compare -type afio
Extract files listed in "restorelist" from an on-disk file:
flexbackup -extract home.0.19990930.afio -flist restorelist
List what backups are on this tape:
flexbackup -toc
----------------------------------------------------------------------
NOTES - GENERAL
Remote: rsh or ssh is used for remote backups. Backups of remote machines
are to be run from the machine with the tape drive or archive disk space.
Archiving to files - just set $device to a directory. Backups will be
called <filesystem>.<level>.<yyyymmdd>.<type>. If you use type "copy" or
"rsync", instead of an archive file you'll get a directory tree with the
files mirrored in it.
Log files are of the format <fs>.<level>.<yyyymmdd> Lower-level backups
will wipe out all higher-level log files in the log directory for that
filesystem. A symlink is made to the "latest" log for a certain
filesystem.
Extracting only lists of files: dump/restore and tar will recurse
into subdirectories if they are in the list. afio and cpio will not
(you must list all the files you want to extract them in that case)
When comparing "dump" archives, and if you only backed up a
subdirectory of a filesystem, you will get errors for the "other"
parts of the filesystem. Similarly, if you extract a dump archive,
remember that it keeps the subdirectory path, the "top" of the
archive is not necessarily the directory you told it to dump, but
rather the mount point of the filesystem
----------------------------------------------------------------------
NOTES - WHEN USING TAPES
The first file on a tape is the "index key" (see "flexbackup -toc").
Therefore, use the -num switch to read specific archives. e.g, to read the
first backup archive on a tape: "flexbackup -list -num 1". Otherwise you
can position it yourself with "mt fsf 1 ; flexbackup -list ... "
Level 0 backups of "all" assume a new tape - will trigger
tape retension and erasure. Other backups move tape to
current end of data and start the backup there.
Backups rewind the tape when done. Other operations leave it where it is.
If you split the "all" level 0 backup into sets, tape numbers start at 0.
If you set device to "host:/dev/tapedevice", you can use remote tape
drives (via rsh/ssh)
I suggest using "afio" for tapes, especially if you want compression. It
compresses one file at a time, so an error will not corrupt your entire
archive like with other types. If you are using on-disk backups, the
archive type doesn't matter as much.
----------------------------------------------------------------------
SAMPLE FILESYSTEM SETUP
Here's a snippet of a config file that I'm using, so you can see how the
filesystem "sets" and pruning options work.
# Configure backup "sets".
# Not needed if you use "-dir <dir>" to backup one tree at a time.
# Each set is a simple space-separated list of filesystems
# Remote filesystems should denoted as 'host:dir'
# You can use anything (other than 'all') as set names
#
# Example:
# $set{'set1'} = "/home /usr";
# $set{'set2'} = "/dir3 machine2:/dir4 machine3:/dir5";
#
# "-set all" will back up all defined sets. If you are doing a full backup
# using tapes, each "set" will go onto a different tape and you will be
# prompted for tape change in between.
#
$set{'homes'} = "/home/user1 /home/user2 /home/user3";
$set{'alletc'} = "/etc hercules:/etc thor:/etc gazelle:/etc";
$set{'other'} = "/var/named /net/local /net/www";
$set{'os'} = "/ hercules:/ thor:/ gazelle:/";
$set{'laptop'} = "laptop:/etc laptop:/home/edwinh";
# Subtree pruning
# A space-separated list of directories to prune from each backup.
# Key is a filesystem or host:dir spec as outlined above
# regular expressions allowed (not shell-type wildcards!)
$prune{'/'} = "tmp proc var/spool/news var/spool/squid disk. mnt.? misc net";
$prune{'hercules:/'} = "tmp proc disk. mnt.? misc net";
$prune{'thor:/'} = "tmp proc disk. mnt.? misc net";
$prune{'gazelle:/'} = "tmp proc disk. mnt.? misc net";
$prune{'/net/local'} = "games";
----------------------------------------------------------------------
SAMPLE CRONTAB
This goes with the above. Shows how the sets are arranged and how the
-wday flag could be used. (You will not want the "root" field for a normal
user crontab... this is in /etc/crontab type format.)
# Home directories at 3:31am
# Daily incremental backups weekdays (catch day-to-day changes)
# Weekly differential backups Saturday (catch all changes since full)
# Full backup - once a month on Sunday only
31 3 * * 1-5 root flexbackup -set homes -incremental
31 3 * * 6 root flexbackup -set homes -differential
31 3 1-7 * * root flexbackup -wday 7 -set homes -full -type afio
# All /etc dirs at 3:01
# Daily incremental backups weekdays (catch day-to-day changes)
# Weekly differential backups Saturday (catch all changes since full)
# Full backup - once a month on Sunday only
1 3 * * 1-5 root flexbackup -set alletc -incremental
1 3 * * 6 root flexbackup -set alletc -differential
1 3 1-7 * * root flexbackup -wday 7 -set alletc -full -type afio
# Other filesystems at 2:31am
# Daily incremental backups weekdays (catch day-to-day changes)
# Weekly differential backups Saturday (catch all changes since full)
# Full backup - once a month on Sunday only
31 2 * * 1-5 root flexbackup -set other -incremental
31 2 * * 6 root flexbackup -set other -differential
31 2 1-7 * * root flexbackup -wday 7 -set other -full -type afio
# Unowned/changed package stuff on each machine at 1:01am
# Only once a month
1 1 1-7 * * root flexbackup -wday 7 -set os -pkgdelta rpm -full
----------------------------------------------------------------------
MISCELLANEOUS
I originally did this to to help automate my life.
See the TODO list for what we might be planning to do next.
Send problems/suggestions to:
Please check the FAQ!
See http://www.flexbackup.org for contact information.
Thanks,
Edwin Huffstutler <[email protected]>
Local Variables:
mode: flyspell
end: