backjar
README
INTRO
-----
backjar is backupping script written in Perl targetted to experienced
administators. backjar is capable of taking GPG encrypted backups and
sending them to remote host using SSH. This is usefull in example if you
want to backup your workstations and servers to one central server which is
not perfectly trusted or is under threat of cracking.
I wrote this script because I did not found any backup-script capable of SSH
and GPG and/or others vere too complicated to understand or set up. Well,
backjar has been evolved to even more complicated script than those I
reviewed but I think I have been able to maintain easiness of installation
and configuration if administrator have some general awarness of *nix /
Linux systems and Perl.
INSTALLATION
------------
Just grab source tarball and extract it to destination suitable. In package
there should be few files, backjar.pl which is actual script and
backjar.conf which is example configuration file. Configuration is done using
'backup sets' each representing one logical set of directories to be
backupped. In example you could create backup sets called 'etc', 'homes',
'var' each backupping one ore more directories. You can use backup set
called 'default' from which backjar will take default values to all other
sets if omitting some values. If you won't be needing of some feature like
'remoteshell' or 'crypter', just set their values to undef or comment them.
There are some values like finder, archiver, compressor, bufferer, crypter,
remoteshell and storer to which you must define program to be used with full
path. Backjar detects what program you are using and tries to use suitable
arguments with programs. Short explanation about programs and why they are
used:
finder: Finder will list all your files to be backupped and be able to list
correct files for incremental bakcups. GNU find is only supported.
archiver: Archiver will join all your files to one single archive file, but
won't compress it yet. Star and GNU tar are supported.
compressor: Compressor is not required (in example if you back up already
copressed files). Gzip and bzip2 are supported.
bufferer: Not required but may assist when backupping to remote server.
buffer is supported.
crypter: For encrypting backups. GPG is supported. Encryption key
is read from file defined in config.
remoteshell: When sending backups to remote server. OpenSSH and SSH2 is
supported (backjar detects /usr/bin as OpenSSH and
/usr/bin/ssh2 as SSH2).
storer: Program which writes backupfile to disk. Only cat is supported
which actually is useless ue of cat but this may give some neat
possibilities in future (perhaps using dvdrecord as storer and
mkisofs as archiver).
Backjar can take incremental backups based on file modification times and
timestamp of last backup. This method does have one drawback: deleted files
will reappear if restoring files from backups taken before deleting files. I
recommend full level 0 backups perioidically. Incremental backups are
handled trough backup 'levels' level 0 being full backup and level 1 being
new/modified files since level 0, level 2 being... Configuration setting
purge won't purge your files but it purges incremental backups when doing
lower level backups :)
Backjar should have read/write access to directory defined in configuration
file setting $dbdir and of course read-access to files you wan't to backup.
You can run backjar as root (unrecommended) or as some other user in which
case you may consider using POSIX ACL:s to grant reading access to backjar.
Scheduling backjar should be done trough cron or some similiar scheduler.
Example entries for cron:
16 04 * * 1 /opt/backjar/backjar.pl -level 0 -quiet -set all -conf /opt/backjar/backjar.conf
09 07 * * * /opt/backjar/backjar.pl -level 1 -quiet -set www -conf /opt/backjar/backjar.conf
09 08-19 * * * /opt/backjar/backjar.pl -level 2 -quiet -set www -conf /opt/backjar/backjar.conf
08 07-19 * * * /opt/backjar/backjar.pl -level 1 -quiet -set databases -conf /opt/backjar/backjar.conf
USAGE
-----
Please run backjar.pl without any arguments and you will get usage help.
Restoring is not scripted so you must use tar or star manually.
REQUIREMENTS
------------
* Perl 5.8
* IPC::Run
* Mail::Sendmail,
(Tested under Linux only)
BUGS
----
* backjar is not very error resistant and backupping can fail due to some
filesystem changes between starting backupping and ending. Error are
reported however always.
* backjar is not resistant to configuration errors at all. Use some *nix
variation of find or tar instead of GNU variations and you will find that
backupping will not succeed.
* aftercmd currently won't work.
TODO
----
* See BUGS.
* Tape/DVD support, perhaps trough aftercmd.
* Pkgdelta known from flexbackup.
* Find DELETED files between incremental backups.
* Some die() calls are used when more controlled exit should be performed.
* Support for different variations of programs.
* -fstype list should be autodetected.
* More verbose output when starting to backup.
* GUI, perhaps with gtk-python.
CHANGELOG
---------
2005-01-03 v0.0.0
* First development version.
2005-05-15 v0.0.1
* Support for emailing errorlog (for batch jobs in example)
* Support for defaults -bakcupset
2005-05-23 v0.0.2
* Sparse files caused script to fail when using star. Added -silent
option to star.
2005-11-27 v0.0.3
* Switched from system() to IPC::Run which allows much better
piping and error detection. Much code rewritten. Propably
will make possible to get some statistics from (s)tar in
future.
* '-level auto' support.
2005-11-27 v0.0.3.1
* Debianizing.
* Some minor documentation changes.
* Some minor code change.
LICENCE
-------
w GNU General Public License, version 2
AUTHOR
------
Jari Eskelinen
DOWNLOAD
backjar tarballbackjar .deb
You can also use my Debian repository and add following-line to /etc/apt/sources.list:
deb http://keitin.net/debian/ binary/