README
1 _____ _ _ _
2 | ___| | _____ _| |__ __ _ ___| | ___ _ _ __
3 | |_ | |/ _ \ \/ / '_ \ / _` |/ __| |/ / | | | '_ \
4 | _| | | __/> <| |_) | (_| | (__| <| |_| | |_) |
5 |_| |_|\___/_/\_\_.__/ \__,_|\___|_|\_\\__,_| .__/
6 |_|
7 http://www.flexbackup.org
8
9----------------------------------------------------------------------
10A flexible backup tool
11
12Features:
13 o Easy to configure
14 o Uses dump, afio, GNU tar, cpio, star, pax, or zip archivers
15 o Full and numbered levels of incremental backup (acts like "dump")
16 o Compression and buffering options for all backup types
17 o Does remote filesystems (over rsh/ssh; no special service)
18 o Package delta mode can backup files not owned by rpm, or owned+changed files.
19 o Writes to tapes, on-disk archive files, or on-disk directory trees
20 o Keeps a table of contents so you know what archives are on each tape
21 o Nice log files
22
23Software needed:
24 o perl
25 o fileutils, findutils (a "find" capable of using the -regex switch)
26 o one or more of
27 dump/restore, afio, GNU tar, star, pax, cpio, zip
28 o mt (if using tapes)
29 o gzip, bzip2, lzop, or compress (optional)
30 o buffer (optional) [needs patches or recompile for 2+GB file support]
31
32See the INSTALL file for installation instructions.
33
34I looked at many other packages and didn't really find anything that
35worked the way I wanted it to. For my needs I felt the existing
36packages were any combination of:
37 o Too complex to setup/use
38 o Lacked documentation
39 o Nonstandard archiving formats
40 o Overkill for a small network of 2 or 3 machines
41 o Too simplistic, or hard-coded assumptions
42 o No scripts helped drive "dump/restore"
43 o Didn't have features I wanted
44
45I also wanted to take the standard backup tools and make a generic
46interface to them.
47
48----------------------------------------------------------------------
49USAGE EXAMPLES
50
51--> Please see "flexbackup -help" and the config file comments, or the
52flexbackup(1) and flexbackup.conf(5) manpages. There are many useful
53options that aren't appropriate to describe here.
54
55To do a full backup of /home:
56
57 flexbackup -dir /home
58
59For nightly incremental backups, run something like this via cron:
60
61 flexbackup -set all -level 9
62
63To do a full backup of /usr from machine "otherhost", forcing cpio type:
64
65 flexbackup -dir otherhost:/usr -type cpio
66
67To do an level 5 incremental backup of a named backup set:
68
69 flexbackup -set backupset2 -level 5
70
71Extract all files from file number 1 on the tape into current directory:
72
73 flexbackup -extract -num 1
74
75Compare afio archive at current tape position with the current
76directory:
77
78 flexbackup -compare -type afio
79
80Extract files listed in "restorelist" from an on-disk file:
81
82 flexbackup -extract home.0.19990930.afio -flist restorelist
83
84List what backups are on this tape:
85
86 flexbackup -toc
87
88----------------------------------------------------------------------
89NOTES - GENERAL
90
91 Remote: rsh or ssh is used for remote backups. Backups of remote machines
92 are to be run from the machine with the tape drive or archive disk space.
93
94 Archiving to files - just set $device to a directory. Backups will be
95 called <filesystem>.<level>.<yyyymmdd>.<type>. If you use type "copy" or
96 "rsync", instead of an archive file you'll get a directory tree with the
97 files mirrored in it.
98
99 Log files are of the format <fs>.<level>.<yyyymmdd> Lower-level backups
100 will wipe out all higher-level log files in the log directory for that
101 filesystem. A symlink is made to the "latest" log for a certain
102 filesystem.
103
104 Extracting only lists of files: dump/restore and tar will recurse
105 into subdirectories if they are in the list. afio and cpio will not
106 (you must list all the files you want to extract them in that case)
107
108 When comparing "dump" archives, and if you only backed up a
109 subdirectory of a filesystem, you will get errors for the "other"
110 parts of the filesystem. Similarly, if you extract a dump archive,
111 remember that it keeps the subdirectory path, the "top" of the
112 archive is not necessarily the directory you told it to dump, but
113 rather the mount point of the filesystem
114
115----------------------------------------------------------------------
116NOTES - WHEN USING TAPES
117
118 The first file on a tape is the "index key" (see "flexbackup -toc").
119 Therefore, use the -num switch to read specific archives. e.g, to read the
120 first backup archive on a tape: "flexbackup -list -num 1". Otherwise you
121 can position it yourself with "mt fsf 1 ; flexbackup -list ... "
122
123 Level 0 backups of "all" assume a new tape - will trigger
124 tape retension and erasure. Other backups move tape to
125 current end of data and start the backup there.
126
127 Backups rewind the tape when done. Other operations leave it where it is.
128
129 If you split the "all" level 0 backup into sets, tape numbers start at 0.
130
131 If you set device to "host:/dev/tapedevice", you can use remote tape
132 drives (via rsh/ssh)
133
134 I suggest using "afio" for tapes, especially if you want compression. It
135 compresses one file at a time, so an error will not corrupt your entire
136 archive like with other types. If you are using on-disk backups, the
137 archive type doesn't matter as much.
138
139----------------------------------------------------------------------
140SAMPLE FILESYSTEM SETUP
141
142Here's a snippet of a config file that I'm using, so you can see how the
143filesystem "sets" and pruning options work.
144
145# Configure backup "sets".
146# Not needed if you use "-dir <dir>" to backup one tree at a time.
147# Each set is a simple space-separated list of filesystems
148# Remote filesystems should denoted as 'host:dir'
149# You can use anything (other than 'all') as set names
150#
151# Example:
152# $set{'set1'} = "/home /usr";
153# $set{'set2'} = "/dir3 machine2:/dir4 machine3:/dir5";
154#
155# "-set all" will back up all defined sets. If you are doing a full backup
156# using tapes, each "set" will go onto a different tape and you will be
157# prompted for tape change in between.
158#
159$set{'homes'} = "/home/user1 /home/user2 /home/user3";
160$set{'alletc'} = "/etc hercules:/etc thor:/etc gazelle:/etc";
161$set{'other'} = "/var/named /net/local /net/www";
162$set{'os'} = "/ hercules:/ thor:/ gazelle:/";
163$set{'laptop'} = "laptop:/etc laptop:/home/edwinh";
164
165# Subtree pruning
166# A space-separated list of directories to prune from each backup.
167# Key is a filesystem or host:dir spec as outlined above
168# regular expressions allowed (not shell-type wildcards!)
169$prune{'/'} = "tmp proc var/spool/news var/spool/squid disk. mnt.? misc net";
170$prune{'hercules:/'} = "tmp proc disk. mnt.? misc net";
171$prune{'thor:/'} = "tmp proc disk. mnt.? misc net";
172$prune{'gazelle:/'} = "tmp proc disk. mnt.? misc net";
173$prune{'/net/local'} = "games";
174
175----------------------------------------------------------------------
176SAMPLE CRONTAB
177
178This goes with the above. Shows how the sets are arranged and how the
179-wday flag could be used. (You will not want the "root" field for a normal
180user crontab... this is in /etc/crontab type format.)
181
182# Home directories at 3:31am
183# Daily incremental backups weekdays (catch day-to-day changes)
184# Weekly differential backups Saturday (catch all changes since full)
185# Full backup - once a month on Sunday only
18631 3 * * 1-5 root flexbackup -set homes -incremental
18731 3 * * 6 root flexbackup -set homes -differential
18831 3 1-7 * * root flexbackup -wday 7 -set homes -full -type afio
189
190# All /etc dirs at 3:01
191# Daily incremental backups weekdays (catch day-to-day changes)
192# Weekly differential backups Saturday (catch all changes since full)
193# Full backup - once a month on Sunday only
1941 3 * * 1-5 root flexbackup -set alletc -incremental
1951 3 * * 6 root flexbackup -set alletc -differential
1961 3 1-7 * * root flexbackup -wday 7 -set alletc -full -type afio
197
198# Other filesystems at 2:31am
199# Daily incremental backups weekdays (catch day-to-day changes)
200# Weekly differential backups Saturday (catch all changes since full)
201# Full backup - once a month on Sunday only
20231 2 * * 1-5 root flexbackup -set other -incremental
20331 2 * * 6 root flexbackup -set other -differential
20431 2 1-7 * * root flexbackup -wday 7 -set other -full -type afio
205
206# Unowned/changed package stuff on each machine at 1:01am
207# Only once a month
2081 1 1-7 * * root flexbackup -wday 7 -set os -pkgdelta rpm -full
209
210
211----------------------------------------------------------------------
212MISCELLANEOUS
213
214 I originally did this to to help automate my life.
215 See the TODO list for what we might be planning to do next.
216
217 Send problems/suggestions to:
218 flexbackup-help@lists.sourceforge.net
219 Please check the FAQ!
220 See http://www.flexbackup.org for contact information.
221
222 Thanks,
223 Edwin Huffstutler <edwinh+flexbackup@edwinh.org>
224
225Local Variables:
226mode: flyspell
227end:
228