File : README.md Maintainer : Felix C. Stegerman <firstname.lastname@example.org> Date : 2013-05-21 Copyright : Copyright (C) 2013 Felix C. Stegerman Version : 0.4.0
baktogit - backup w/ git
baktogit uses rsync to incrementally backup files and directories to a git repository -- mostly intended for configuration files. If requested, baktogit will also push to a remote.
You may also be interested in etckeeper ; in contrast to baktogit (which copies configuration files to a git repository), etckeeper keeps /etc itself in version control.
You should be careful about including files like
must remain secret; you should probably
chmod 700 the directory
containing your repository, and be very careful with
clones, and remotes; the etckeeper  README has more information
on the security implications of keeping these kinds of files in
Files you may want to exclude are:
/etc/ssh/ssh_host_*_key and any other private keys and
configuration files with passwords.
$ mkdir -p /opt/src $ git clone https://github.com/obfusk/baktogit.git \ /opt/src/baktogit
$ export BAKTOGIT_REPO=/path/to/repo # must be a git repo $ export BAKTOGIT_PUSH=yes # to push as well $ export VERBOSE=yes # to be verbose $ /opt/src/baktogit/baktogit.bash /a/foo /b/bar /c/qux \ --exclude=/a/foo/some/file # absolute paths!
You'll need to
Arguments will be passed on to rsync; as long as you only use paths,
--exclude-from (or know what you are doing), all
should be well.
$ cp -i /opt/src/baktogit/baktogit.cron.sample \ /etc/cron.daily/baktogit $ vim /etc/cron.daily/baktogit $ chmod +x /etc/cron.daily/baktogit
You may also want to combine baktogit with mailer , to send a report per email.
 GNU General Public License, version 2 --- http://www.opensource.org/licenses/GPL-2.0
 etckeeper --- https://github.com/joeyh/etckeeper
 mailer --- https://github.com/obfusk/mailer