Suggestions/additions welcome
FAQ Revised: Wednesday 03 December 2003 21:30:27
$set{'tag1'} = "/dir1 /dir2 ..."; $set{'tag2'} = "/dir3 host:/dir4 ...";
You can test exclusion, levels, pruning, and package deltas by using "-type filelist". This writes a text file listing all files that would have been backed up into your current working directory.
You can also test to see if your expression matches what you want to
exclude by:
cd <topdir>; find . -regex "<expression>"
$path{command} = 'sudo command';
in the config file.
Do this for all commands that will need privilege (find, afio/tar/etc)
Cmnd_Alias BACKUP = /usr/bin/afio, /usr/bin/find
backupuser ALL = NOPASSWD: BACKUP
$path{'dump'} = 'ufsdump';
. You can
use this mechanism to override paths or just change command names.In the future we might add a way to set up "smbtar" or something similar...
$device
dir.
Note that archive-to-disk with remote directories ($device =
host:/path/to/dir
) is not currently possible. You need to either run the
backup from the machine with the disk, or use NFS.
$set{'backup'} = "'/path/file system 1' '/path/file system 2'";
See also these sun docs for an example with some pictures.
Traditional Unix 'dump' behavior only allows levels 0-9; flexbackup removes this limit if you are using any of the non-dump archive formats.
For those people coming from other platforms that are not used to
dump-style numeric levels, the latest versions of flexbackup have added
-full
, -differential
, -incremental
that get translated into appropriate dump-style level numbers.
Definitions:
These are simply aliased to numeric levels: full = 0, differential = 1, and
incremental = (latest backup + 1)
As of now, having one directory archive span multiple tapes is not supported. True, some of the archiver programs can deal with end-of media if and only if they are writing directly to the device, but it can't be done in a shell pipeline, or in any kind of generic fashion. For now, split the directory up into workable portions, use larger media, or backup to disk...
We need a program like "buffer", but that also deals with the volume end detection & media change prompting, has configuraable "new tape" scripts, etc.
Version 1.2.1 has basic support for using mbuffer with multivolumes.
Please try it out and let me know.
$staticfiles
to true in the config file. Archives will
then have names such as "etc.3.dump.gz" rather than something like
"home.0.200301212305.afio-bz2". There is a similar parameter for the log
files, by the way.Some older programs/systems barf at 2GB files -- anything recent should deal with large files no problem, using standard APIs.
If you are using "buffer" be aware that you need to compile with extra flags, or patch the 1.19 version to handle >2GB files. (The RPMS linked to from this site have been)
See also Large File
Support in Linux or Large
file size changes to the single Unix spec for more info and hints on
how to fix things if you need to recompile something.
To quickly extract just a single file, use "-extract -onefile path/to/my/file", giving the path from the archive.
To extract a list of multiple files, put them into a text file, for
instance "restorelist", then use "-extract -flist restorelist". The format
is one line per pathname, using the path of the file in the archive. Note
if you are using afio with compression you need to append ".z" to
filenames for any compressed files (depends on threshold and exclusion patterns).
dd if=/dev/tapedevice bs=10k | gzip -dc | tar xvf -
afio -i -k -x -P bzip2 -Q -d -Z -v
flexbackup -test-tape-drive
. It writes a couple
small files to the tape, then reads & diffs them. This will flush out any
problems with parameters like blocking, filemarks, and padding; or issues
with the tape drive or driver itself.
If it fails, try these one at a time:
$buffer='false'
) until you can get things working without it.
$blksize
) in the configuration file. The default is 10k, but some tape drives like 32k or 64k much better.
$pad_blocks
to false
$mt_blocksize
.
$indexes
set to false
If you are using an IDE tape drive under Linux, and are still having trouble, you might also try the 'ide-scsi' layer with the 'st' module, and treating the thing like a SCSI tape - I've had more success that way.
You can also just try writing/reading stuff straight from the drive with
an archiver and dd (to factor flexbackup out of the loop), although that's what the
-test-tape-drive
switch tries to do. If you can get that working,
but flexbackup still seems to malfunction, let us know. Try things like:
(The example below uses afio to test, tar/cpio/others will be different)
# Backup two dirs mt -f /dev/tape setblk 32768 mt -f /dev/tape rewind mt -f /dev/tape erase find /dir1 -print | afio -o -z -v -b 32k - | dd ibs=32k obs=32k of=/dev/tape find /dir2 -print | afio -o -z -v -b 32k - | dd ibs=32k obs=32k of=/dev/tape # List mt -f /dev/tape rewind dd ibs=32k obs=32k if=/dev/tape | afio -t -z -v -b 32k - dd ibs=32k obs=32k if=/dev/tape | afio -t -z -v -b 32k -
If you are using ssh and are having a problem with it asking for a
password, then you don't have a passphrase-less authorized key set up, your
RSAAuthentication parameters are incorrect, or you have some other
public/private key problem. Section 7.2.2 of the ssh FAQ might
help:
http://www.onsight.com/faq/ssh/ssh-faq.html
In a nutshell the value of your ~/.ssh/identity.pub
needs to
be present in your ~/.ssh/authorized_keys
file for RSA
authentication to work. For root accounts you might also need to
put
PermitRootLogin yes
in your sshd_config
file, as root is treated with more care than normal user accounts. Note:
you might choose without-password or forced-commands-only instead of yes
for more security. See your ssh(1) and sshd(1) man pages.
If you do not want to use passphrase-less ssh keys with root logins, See
the section on use with "sudo". (Or else sit at the terminal and type
passwords during the backups if you *really* want to...)
$buffer_megs
to a lower value and try again. I usually
run with it set somewhere between 5-20MB.
On FreeBSD, SysV shared memory can run low using the GENERIC kernel at
its default value (especially if you are running something like GNOME). You
can modify your kernel file and change the line
options SHMMAXPGS=2048
To something really big. You can also change this dynamically at startup by
putting
kern.ipc.shmmax={large integer}
in /etc/sysctl.conf. Other BSD's will have very similar mechanisms.
$erase_rewind_only
to true - then an
"erase" operation becomes just a rewind. If an archive is then written,
filemarks and tape end-of-data should work fine.
Also, this hang can be caused by incorrect tape drive parameters on some
systems. Try "flexbackup -test-tape-drive". If it hangs, and there is a dd
or buffer process continuously running, kill it and adjust blocksizes and/or
padding.
$mt{'rdhpos'} = 'rdspos';
If flexbackup detects a non-zero exit status for any command in the pipeline, it will stop. You can override this with the "--ignore-errors" switch, but then it will just blindly continue on such cases. You have been warned.
Some archivers are more picky than others. You can try switching the archive type.
If it is something like a SQL database data file causing the problem, you
should dump the database to a secondary location and back THAT data up.
(See the mysqldump command, for instance).
Flexbackup can use a "package delta" mode that cuts down the number of files to be archived by basically doing the following:
It was orginally intended for use with RPM-based systems ("-pkgdelta rpm"). Initial support for FreeBSD packages is included ("-pkgdelta freebsd"), although there the "base" files aren't part of a package so they can't be excluded.
If someone knows how to do the equivalent things for
.deb packages or others, let me know and we can add it.
Now, tell me you how to set up a cron job to run once a month on the first Sunday only.... you can't do it.
The "-wday" flag tells flexbackup to just exit if the current day of the week does not match the flag. To fulfill the above requirement, you add a cron entry like this:
0 3 1-7 * * flexbackup -wday 7 -set all ....Which will run at 3:00AM on the first Sunday of every month.
And no, using this kind of cron entry:
0 3 1-7 * 7 flexbackup -set all ....will not work. From the crontab(5) manpage:
Note: The day of a command's execution can be specified by two fields - day of month, and day of week. If both fields are restricted (ie, aren't *), the command will be run when either field matches the current time.
$indexes =
'false';
in the config file, and just use written labels on the
tapes...FAQ compilation thanks to makefaq