3
B A C K U P N I N J A /()/
6
a silent flower blossom death strike to lost data.
8
Backupninja allows you to coordinate system backup by dropping a few
9
simple configuration files into /etc/backup.d/. Most programs you
10
might use for making backups don't have their own configuration file
11
format. Backupninja provides a centralized way to configure and
12
coordinate many different backup utilities.
15
- easy to read ini style configuration files.
16
- secure, remote, incremental filesytem backup (via rdiff-backup).
17
incremental data is compressed. permissions are retained even
18
with an unpriviledged backup user.
19
- backup of mysql databases (via mysqlhotcopy and mysqldump).
20
- backup of ldap databases (via slapcat and ldapsearch).
21
- passwords are never sent via the command line to helper programs.
22
- you can drop in scripts to handle new types of backups.
24
The following options are available:
26
-d Run in debug mode, where all log messages are output
28
-f <file> Use <file> for the main configuration instead of
34
The general configuration file is /etc/backupninja.conf. In this file
35
you can set the log level and change the default directory locations.
36
You can force a different general configuration file with "backupninja
39
To preform the actual backup, backupninja processes each configuration
40
file in /etc/backup.d according to the file's suffix:
42
.sh -- run this file as a shell script.
43
.rdiff -- this is a configuration for rdiff-backup
44
.maildir -- this is a configuration to backup maildirs
45
.mysql -- mysql backup configuration
46
.ldap -- ldap backup configuration
48
Support for additional configuration types can be added by dropping
49
bash scripts with the name of the suffix into /usr/share/backupninja.
51
The configuration files are processed in alphabetical order. However,
52
it is suggested that you name the config files in "sysvinit style."
60
Typically, you will put a '.rdiff' config file last, so that any
61
database dumps you make are included in the filesystem backup.
62
Configurations files which begin with 0 (zero) are skipped.
64
Unless otherwise specified, the config file format is "ini style."
77
i will not have a pear.
82
Backupninja can be used to impliment whatever backup strategy you
83
choose. It is intended, however, to be used like so:
85
(1) First, databases are safely copied or exported to /var/backups.
86
Typically, you cannot make a file backup of a database while it
87
is in use, hence the need to use special tools to make a safe copy
88
or export into /var/backups.
90
(2) Then, vital parts of the file system, including /var/backups, are
91
nightly pushed to a remote, off-site, hard disk (using
92
rdiff-backup). The local user is root, but the remote user is not
93
priviledged. Hopefully, the remote filesystem is encrypted.
95
There are many different backup strategies out there, including "pull
96
style", magnetic tape, rsync + hard links, etc. We believe that the
97
strategy outlined above is the way to go because: (1) hard disks are
98
very cheap these days, (2) pull style backups are no good, because then
99
the backup server must have root on the production server, and (3)
100
rdiff-backup is more space efficient and featureful than using rsync +
106
In order for rdiff-backup to sync files over ssh unattended, you must
107
create ssh keys on the source server and copy the public key to the
108
remote user's authorized keys file. For example:
110
root@srchost# ssh-keygen -t dsa
111
root@srchost# ssh-copy-id -i /root/.ssh/id_dsa.pub backup@desthost
113
Now, you should be able to ssh from user 'root' on srchost to
114
user 'backup' on desthost without specifying a password.
116
Note: when prompted for a password by ssh-keygen, just leave it
117
blank by hitting return.
123
apt-get install bash gawk
126
apt-get install rdiff-backup gzip
129
/usr/sbin/backupninja -- main script
130
/etc/cron.d/backupninja -- runs main script nightly
131
/etc/logrotate.d/backupninja -- rotates backupninja.log
132
/etc/backup.d/ -- directory for configuration files
133
/etc/backupninja.conf -- general options
134
/usr/share/backupninja -- handler scripts which do the actual work
137
There is no install script, but you just need to move files to the
138
correct locations. All files should be owned by root.
140
# tar xvzf backupninja.tar.gz
142
# mv backupninja /usr/sbin/backupninja
143
# mv etc/logrotate.d/backupninja /etc/logrotate.d/backupninja
144
# mv etc/cron.d/backupninja /etc/cron.d/backupninja
145
# mkdir /etc/backup.d/
146
# mv etc/backupninja.conf /etc/backupninja.conf
147
# mv handlers /usr/share/backupninja