...
 
Commits (123)
Makefile.in
aclocal.m4
autom4te.cache/
configure
etc/Makefile.in
examples/Makefile.in
handlers/Makefile.in
install-sh
lib/Makefile.in
man/Makefile.in
missing
src/Makefile.in
Makefile
backupninja.spec
config.log
config.status
etc/Makefile
etc/backupninja.conf
etc/cron.d/backupninja
etc/logrotate.d/backupninja
examples/Makefile
handlers/Makefile
handlers/borg
handlers/borg.helper
handlers/dup
handlers/dup.helper
handlers/ldap
handlers/ldap.helper
handlers/maildir
handlers/makecd
handlers/makecd.helper
handlers/mysql
handlers/mysql.helper
handlers/pgsql
handlers/pgsql.helper
handlers/rdiff
handlers/rdiff.helper
handlers/rsync
handlers/sh
handlers/svn
handlers/sys
handlers/sys.helper
handlers/tar
handlers/tar.helper
handlers/trac
lib/Makefile
lib/easydialog
lib/parseini
lib/tools
lib/vserver
man/Makefile
src/Makefile
src/backupninja
src/ninjahelper
.vagrant
This diff is collapsed.
Upstream
========
* prepare the environment:
export VERSION=x.y.z
* update `configure.ac` and `ChangeLog`
perl -pi -E \
"s{^AC_INIT\(\[backupninja\],\[[0-9.]+\],}{AC_INIT([backupninja],[$VERSION],}" \
configure.ac && \
RELEASE_DATE=$(LC_ALL=C date '+%B %d, %Y') perl -pi -E \
"s{^version\s+[0-9.]+\s+--\s+UNRELEASED$}{version $VERSION -- $RELEASE_DATE}" \
ChangeLog
* commit, tag and create the tarball:
git commit configure.ac ChangeLog \
-m "Releasing backupninja $VERSION" && \
git clean -fdx && \
git tag -s "backupninja-$VERSION" \
-m "Releasing backupninja $VERSION" && \
./autogen.sh && \
./configure && \
make dist
* compare the content of the generated tarball with the content of the
previous one
* move the tarball outside of the Git working copy and clean up:
mkdir -p ../tarballs && \
mv backupninja-$VERSION.tar.gz ../tarballs/ && \
make distclean && \
git clean -fdx
* Install (extract tarball, `.configure && make && sudo make install`)
and test.
Debian
======
Prepare a new package:
git checkout debian && \
gbp import-orig --upstream-vcs-tag="backupninja-$VERSION" \
../tarballs/backupninja-$VERSION.tar.gz && \
gbp dch --auto && \
dch -e && \
export DEBIAN_VERSION=$(dpkg-parsechangelog -SVersion) && \
git commit debian/changelog \
-m "Releasing backupninja ($DEBIAN_VERSION) to Debian unstable" && \
gbp buildpackage
Install the `.deb` and test.
Release
=======
* sign the release and push it to Git:
gpg --armor --detach-sign \
../tarballs/backupninja-$VERSION.tar.gz && \
git checkout debian && \
gbp buildpackage --git-tag-only --git-sign-tags && \
git push --follow-tags origin \
master:master \
debian:debian \
pristine-tar:pristine-tar \
upstream:upstream
* upload the upstream tarball and detached signature to the GitLab
milestone page with *Edit**Attach a file*
* announce the release on the backupninja mailing-list,
pointing to the milestone web page
* upload to Debian or ask someone listed in the `Uploaders` control
field to review and upload
Open the next development cycle
===============================
* `git checkout master`
* Add an empty new section in `ChangeLog`, commit and push.
# -*- mode: ruby -*-
# vi: set ft=ruby :
ENV["LC_ALL"] = "en_US.UTF-8"
Vagrant.configure("2") do |config|
config.vm.box = "debian/stretch64"
config.vm.provision "shell", inline: <<-SHELL
locale-gen
apt-get update
apt-get install -y git automake make
git clone https://0xacab.org/riseuplabs/backupninja.git
chown vagrant: backupninja -R
SHELL
end
This diff is collapsed.
%define name backupninja
%define version 1.1.0
Summary: Backupninja backup tool
Name: %{name}
Version: %{version}
Release: 1
License: GPL
Group: Applications/System
URL: https://0xacab.org/riseuplabs/backupninja
Source: %{name}-%{version}.tar.gz
Requires: bash, gawk, rdiff-backup, gzip
Provides: %{name}
Packager: Petr Klima <Petr.Klima@madeta-group.cz>
BuildRoot: %{_tmppath}/%{name}-%{version}
Prefix: %{_prefix}
%description
Modular rdiff.backup tool
%prep
%setup -q
%build
%configure
make
%install
rm -rf ${buildroot}
%makeinstall
mkdir -p "%{buildroot}%{_sysconfdir}/backup.d"
mkdir -p "%{buildroot}%{_localstatedir}/backups"
mkdir -p "%{buildroot}%{_localstatedir}/log"
touch "%{buildroot}%{_localstatedir}/log/backupninja.log"
%clean
rm -fr %{buildroot}
%files
%defattr(-,root,root,-)
%{_sbindir}/*
%{_datadir}/backupninja/*
%{_libdir}/backupninja/*
%config %{_sysconfdir}/cron.d/backupninja
%config %{_sysconfdir}/logrotate.d/backupninja
%config(noreplace) %{_sysconfdir}/backupninja.conf
%dir %{_localstatedir}/backups
%ghost %{_localstatedir}/log/backupninja.log
%doc AUTHORS COPYING ChangeLog INSTALL.md NEWS README.md
%{_mandir}/man1/*
%{_mandir}/man5/*
%defattr(0640,root,root,0750)
%dir %{_sysconfdir}/backup.d
%changelog
* Sun Oct 14 2007 Adam Monsen <haircut@gmail.com> 0.9.5-1
- use cleanup steps during %install and %clean
* Mon Apr 29 2002 Petr Klima <Petr.Klima@madeta-group.cz> 0.7.0
- first RPM release
This diff is collapsed.
backupninja (1.0~rc1-1) unstable; urgency=low
duplicity 0.6.17 and later has moved to a new sftp/scp backend
which no longer uses sftp/scp client programs, but instead relies on
paramiko, a Python ssh+sftp implementation.
Therefore, the sshoptions option of the backupninja duplicity handler
cannot be used for anything but the one supported by this new backend:
-oIdentityfile=some_key_file -- all other ssh options are ignored.
-- intrigeri <intrigeri@debian.org> Fri, 27 Apr 2012 23:07:11 +0200
backupninja (0.9.10-1) unstable; urgency=low
Being severely broken for ages (see #596935), LDAP support was removed upstream.
It will come back once this code has found itself a maintainer.
Interested? Get in touch!
-- intrigeri <intrigeri+debian@boum.org> Fri, 23 Sep 2011 17:32:11 +0200
backupninja (0.9.8-1) unstable; urgency=low
* duplicity 0.6.01 and later defaults to using an archive (cache)
directory, which was previously opt-in. Starting with backupninja
0.9.8, the backupninja duplicity handler puts this cache into
/var/cache/backupninja/duplicity unless specified by the user with
the "options" setting the *.dup job.
When backups have been performed with backupninja older than 0.9.8 in
conjunction with duplicity 0.6.01 or later, e.g. when using Sid or
Squeeze at certain times of the Squeeze release cycle, cache files
were probably saved into /root/.cache/duplicity; one may want to
delete these files, or rather save bandwidth and just move the cache
directory to the new location:
mkdir -p /var/cache/backupninja
mv /root/.cache/duplicity /var/cache/backupninja/
It is probably desirable to exclude this cache directory from
duplicity backup sets to avoid some kind of reentrant backup problem.
-- Micah Anderson <micah@riseup.net> Sun, 12 Sep 2010 19:58:49 +0200
backupninja (0.9.4-1) unstable; urgency=low
* duplicity: Old (pre-0.9.4) example.dup file used to give false
information about the way the GnuPG-related options are used.
Please read the new /usr/share/doc/backupninja/examples/example.dup
file, and update your own configuration files if needed.
* duplicity, rdiff: symlinks and globbing support in
include/exclude/vsinclude was unclear and did not work in all
situations, with weird behavious, due to incompatibilities
between various readlink versions in this field. This has been made
clear eventually: globbing is fully supported again, whereas no
attempt is done to dereference symlinks anymore.
Please read the new /usr/share/doc/backupninja/examples/example.dup
or /usr/share/doc/backupninja/examples/example.rdiff file, and update
your own configuration files if needed.
* duplicity: duplicity now uses sftp, which does not support all scp
command line options; you thus have to convert the sshoptions setting
in your *.dup configuration files, to sftp-compatible syntax; for
example, you can replace:
sshoptions = -i /root/.ssh/id_dsa_duplicity
with:
sshoptions = -o IdentityFile=/root/.ssh/id_dsa_duplicity
-- Micah Anderson <micah@riseup.net> Fri, 6 Oct 2006 13:04:45 -0600
backupninja (0.9.2-1) unstable; urgency=low
WARNING FOR DUPLICITY USERS
Old (pre-0.9.2) example.dup file used to give false information about the way
the GnuPG-related options are used. Please read the new example.dup file, and
update your own configuration files if needed.
-- Micah Anderson <micah@riseup.net> Thu, 29 Dec 2005 14:21:48 -0500
usr/lib
usr/sbin
usr/share/backupninja
etc/backup.d
examples/example.dup
examples/example.maildir
examples/example.makecd
examples/example.mysql
examples/example.pgsql
examples/example.rdiff
examples/example.rsync
examples/example.sh
examples/example.svn
examples/example.sys
examples/example.trac
debian/backupninja/etc/backupninja.conf
# Policy §10.9 wants 0755 or 2770 but since secrets could be stored there
# we want this only accessed by root, and optionally by the "admingroup"
# defined in backupninja.conf
non-standard-dir-perm etc/backup.d/ 2770 != 0755
# The first occurrence is for the handler, the 2nd is for the package
spelling-error-in-description rsync rsync (duplicate word) rsync
#!/bin/sh
set -e
# Remove the erroneous /etc/logrotate.d/backupninja directory if it exists
if [ -d /etc/logrotate.d/backupninja ]
then
rm -f /etc/logrotate.d/backupninja/backupninja
rmdir /etc/logrotate.d/backupninja
if [ $? -ne 0 ]
then
cat << EOF
The /etc/logrotate.d/backupninja directory was created incorrectly by an earlier
version of this package. When trying to remove this directory file(s) were found
inside this directory. There should be no files in this directory at all.
Installation of this package will not proceed until you have cleaned this
directory out.
EOF
exit 1
fi
fi
# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.
#DEBHELPER#
exit 0
This diff is collapsed.
Source: backupninja
Section: admin
Priority: optional
Maintainer: Debian backupninja maintainers <pkg-backupninja@lists.riseup.net>
Uploaders: Micah Anderson <micah@riseup.net>,
intrigeri <intrigeri@debian.org>,
Jerome Charaoui <jerome@riseup.net>
Build-Depends:
debhelper (>= 10)
Build-Conflicts: autoconf2.13
Standards-Version: 4.1.4
Homepage: https://0xacab.org/riseuplabs/backupninja
Vcs-Browser: https://0xacab.org/riseuplabs/backupninja/tree/debian
Vcs-Git: https://0xacab.org/riseuplabs/backupninja.git
Package: backupninja
Architecture: all
Depends:
gawk | mawk,
dialog,
bash (>=2.05b-26),
bsd-mailx | mailx | mailutils,
${misc:Depends}
Suggests:
bzip2,
debconf-utils,
duplicity,
genisoimage,
fdisk | util-linux (<< 2.29.2-3~),
hwinfo,
mdadm,
rdiff-backup,
rsync,
subversion,
trickle,
wodim,
borgbackup
Description: lightweight, extensible meta-backup system
Backupninja lets you drop simple config files in /etc/backup.d to
coordinate system backups. Backupninja is a master of many arts,
including incremental remote filesystem backup, and MySQL backup.
By creating simple drop-in handler scripts, backupninja can learn new skills.
Backupninja is a silent flower blossom death strike to lost data.
.
In addition to backing up regular files, Backupninja has handlers to ease
backing up: Maildir, MySQL, PostgreSQL, SVN, Trac, hardware and system
information, as well as the output from custom shell scripts.
.
Backupninja currently supports common backup utilities, easing their
configuration, currently supported are: rdiff-backup, duplicity, rsync,
borgbackup and CD/DVD.
.
Most handlers have their own dependencies/recommendations, shown in brackets
below:
.
- dup [duplicity, trickle]
- rdiff [rdiff-backup]
- sys [debconf-utils, hwinfo, mdadm]
- makecd [genisoimage, wodim]
- rsync [rsync]
- svn [subversion]
- tar [bzip2]
- borg [borgbackup]
This was turned into a debian package by Micah Anderson <micah@riseup.net> on
Sat, 18 Sep 2004 16:03:11 -0500.
The upstream source was obtained from
https://0xacab.org/riseuplabs/backupninja
The Git repository can be viewed at
https://0xacab.org/riseuplabs/backupninja/tree/debian
backupninja was originally written by elijah@riseup.net, for a full list of
authors see AUTHORS.
Copyright (C) 2004-2010 Riseup Networks
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to:
Free Software Foundation, Inc.
51 Franklin St, Fifth Floor
Boston, MA 02110-1301, USA.
On Debian GNU/Linux systems, the complete text of the GNU General Public
License can be found in the /usr/share/common-licenses' directory.
README.md
AUTHORS
[DEFAULT]
upstream-branch = upstream
debian-branch = debian
upstream-tag = backupninja_upstream/%(version)s
debian-tag = backupninja_debian/%(version)s
pristine-tar = True
#!/usr/bin/make -f
# -*- makefile -*-
PACKAGE = backupninja
TMP = $(CURDIR)/debian/$(PACKAGE)
%:
dh $@
override_dh_auto_configure:
dh_auto_configure -- \
--libdir=\$${prefix}/lib \
--libexecdir=\$${prefix}/lib
override_dh_auto_install:
dh_auto_install
chmod a-x $(TMP)/usr/lib/backupninja/parseini
chmod a-x $(TMP)/usr/lib/backupninja/vserver
rm $(TMP)/usr/share/backupninja/example.*
override_dh_compress:
dh_compress -Xexample
override_dh_fixperms:
dh_fixperms
chmod 2770 $(TMP)/etc/backup.d
override_dh_installchangelogs:
dh_installchangelogs ChangeLog
# Upstream does not publish any tarball other than GitLab-generated ones,
# that should not be imported directly via uscan and gbp import-orig,
# so debian/watch is voluntarily not provided in order to avoid malformed
# imports.
backupninja: debian-watch-file-is-missing
extend-diff-ignore = "(^|/)(aclocal.m4|config\.sub|config\.guess|configure|install-sh|Makefile|Makefile.in|missing)$"
This diff is collapsed.
This diff is collapsed.
##
## configuration file for openldap backups
##
## If the method is set to "slapcat", the LDIFs generated are
## suitable for use with slapadd. As the entries are in database
## order, not superior first order, they cannot be loaded with
## ldapadd without being reordered.
##
## backupdir (default /var/backups/ldap): the destination for the backups
# backupdir = /var/backups/ldap
## conf (default /etc/ldap/slapd.conf): the location of the slapd.conf file.
# conf = /etc/ldap/slapd.conf
## databases (default all): either a space separated list of database
## numbers or prefixes, or the keyword 'all'.
# databases = all
## compress (default yes): if set to yes, ldif exports are gzipped.
# compress = yes
## restart (default no): if set to yes, slapd is stopped before backups are
## performed, and then started again after they have finished, this is necessary
## if your backend is ldbm and your method is slapcat, but unnecessary otherwise.
# restart = no
## method (default ldapsearch): either 'ldapsearch' or 'slapcat'
## ldapsearch is the safer method to do backups, but is slow, slapcat
## is much faster, but should not be done on an ldbm backend unless you have
## restart set to yes
## NOTE: with the ldapsearch method passwordfile and binddn need to be set
# method = ldapsearch
## passwordfile (no default): this should be set to the file that contains
## your ldap password, this is required for ldapsearch and not needed for slapcat
## this file should have no newlines in it, echo -n "password" > passfile works.
## NOTE: be sure to set the permissions on your password file appropriately
## (hint: world readable is not appropriate)
# passwordfile =
## binddn (no default): set this to the DN of the user that the ldapsearch binds
## to, not needed for slapcat
# binddn =
## ldaphost (no default): set this to your ldap host if it is not local
# ldaphost =
## ssl (default yes): if set to 'yes' then SSL connection will be
## attempted to your ldaphost by using ldaps://
# ssl = yes
## tls (default no): if set to 'yes' then TLS connection will be
## attempted to your ldaphost by using TLS extended operations (RFC2246,
## RFC2830)
# tls = no
This diff is collapsed.
This diff is collapsed.
# -*- mode: sh; sh-basic-offset: 3; indent-tabs-mode: nil; -*-
# vim: set filetype=sh sw=3 sts=3 expandtab autoindent:
HELPERS="$HELPERS ldap:ldap_database_backup"
ldap_create_file() {
while true; do
checkBox "ldap action wizard" "check options (slapcat OR ldapsearch)" \
"slapcat" "export ldif using slapcat" yes \
"ldapsearch" "export ldif using ldapsearch" no \
"compress" "compress the ldif output files" yes \
"ssl" "use SSL (deprecated)" no \
"tls" "use TLS extended operations (RFC2246, RFC2830)" yes
status=$?
compress="compress = no"
method="method = <unset>"
restart="restart = no"
binddn=""
passwordfile=""
ssl="ssl = no"
tls="tls = no"
[ $status = 1 ] && return;
result="$REPLY"
for opt in $result; do
case $opt in
'"compress"') compress="compress = yes";;
'"slapcat"')
method="method = slapcat"
[ "$_RESTART" == "yes" ] && restart="restart = yes"
;;
'"ldapsearch"')
method="method = ldapsearch"
inputBox "ldap action wizard" "ldapsearch requires authentication. Specify here what password file to use. It must have the password with no trailing return and it should not be world readable."
[ $? = 1 ] && return
passwordfile="passwordfile = $REPLY"
inputBox "ldap action wizard" "ldapsearch requires authentication. Specify here what DN to bind as:"
[ $? = 1 ] && return
binddn="binddn = $REPLY"
require_packages ldap-utils
;;
'"ssl"') ssl="ssl = yes";;
'"tls"') tls="tls = yes";;
esac
done
get_next_filename $configdirectory/30.ldap
cat > $next_filename <<EOF
$method
$compress
$restart
$binddn
$passwordfile
$ssl
$tls
# backupdir = /var/backups/ldap
# conf = /etc/ldap/slapd.conf
# databases = all
EOF
chmod 600 $next_filename
return
done
}
ldap_wizard() {
bdb=no
hdb=no
ldbm=no
for backend in `grep -e "^backend" /etc/ldap/slapd.conf | @AWK@ '{print $2}'`; do
if [ "$backend" == "bdb" ]; then
bdb=yes
elif [ "$backend" == "hdb" ]; then
hdb=yes
elif [ "$backend" == "ldbm" ]; then
ldbm=yes
fi
done
if [ "$bdb" == "yes" -o "$hdb" == "yes" ]; then
if [ "$ldbm" == "no" ]; then
msgBox "ldap action wizard" "It looks like the backend in your slapd.conf is set to BDB or HDB. If this is not the case, exit this wizard! From this point on, we will assume BDB or HDB backend, which might have disasterious consequences if this is incorrect."
_RESTART=no
ldap_create_file
fi
elif [ "$ldbm" == "yes" ]; then
msgBox "ldap action wizard" "It looks like the backend in your slapd.conf is set to LDBM. Because of this, you will have less options (because it is not safe to use slapcat while slapd is running LDBM)."
_RESTART=yes
ldap_create_file
else
msgBox "ldap action wizard" "I couldn't find any supported backend in your slapd.conf. Bailing out."
return
fi
}
# -*- mode: sh; sh-basic-offset: 3; indent-tabs-mode: nil; -*-
# vim: set filetype=sh sw=3 sts=3 expandtab autoindent:
#
# openldap backup handler script for backupninja
#
getconf backupdir /var/backups/ldap
getconf conf /etc/ldap/slapd.conf
getconf databases all
getconf compress yes
getconf ldif yes
getconf restart no
getconf method ldapsearch
getconf passwordfile
getconf binddn
getconf ldaphost
getconf ssl yes
getconf tls no
if [ $ssl = 'yes' ]; then
URLBASE="ldaps"
else
URLBASE="ldap"
fi
status="ok"
[ -f $conf ] || fatal "slapd config file ($conf) not found"
[ -d $backupdir ] || mkdir -p $backupdir
[ -d $backupdir ] || fatal "Backup directory '$backupdir'"
dbsuffixes=(`@AWK@ 'BEGIN {OFS=":"} /[:space:]*^database[:space:]*\w*/ {db=$2}; /^[:space:]*suffix[:space:]*\w*/ {if (db=="bdb"||db=="hdb"||db="ldbm") print db,$2}' $conf|@SED@ -e 's/[" ]//g'`)
## LDIF DUMP
if [ "$ldif" == "yes" ]; then
dumpdir="$backupdir"
[ -d $dumpdir ] || mkdir -p $dumpdir
if [ "$databases" == 'all' ]; then
dbcount=`grep '^database' $conf | wc -l`
let "dbcount = dbcount - 1"
databases=`seq 0 $dbcount`;
fi
for db in $databases; do
if [ `expr index "$db" "="` == "0" ]; then
# db is a number, get the suffix.
dbsuffix=${dbsuffixes[$db]/*:/}
else
dbsuffix=$db
fi
# some databases don't have suffix (like monitor), skip these
if [ "$dbsuffix" == "" ]; then
continue;
fi
if [ "$method" == "slapcat" ]; then
execstr="$SLAPCAT -f $conf -b $dbsuffix"
else
LDAPARGS=""
if [ "$tls" == "yes" ]; then
LDAPARGS="-ZZ"
fi
if [ -n "$ldaphost" ]; then
execstr="$LDAPSEARCH $LDAPARGS -H $URLBASE://$ldaphost -x -L -b ""$dbsuffix"" -D ""$binddn"" -y $passwordfile"
else
execstr="$LDAPSEARCH -H $URLBASE://$ldaphost -x -L -b ""$dbsuffix"" -D ""$binddn"" -y $passwordfile"
fi
[ -f "$passwordfile" ] || fatal "Password file $passwordfile not found. When method is set to ldapsearch, you must also specify a password file."
debug "$execstr"
fi
if [ ! $test ]; then
if [ "$restart" == "yes" ]; then
debug "Shutting down ldap server..."
/etc/init.d/slapd stop
fi
ext=
if [ "$compress" == "yes" ]; then
ext=".gz"
fi
touch $dumpdir/$dbsuffix.ldif$ext
if [ ! -f $dumpdir/$dbsuffix.ldif$ext ]; then
fatal "Couldn't create ldif dump file: $dumpdir/$dbsuffix.ldif$ext"
fi
if [ "$compress" == "yes" ]; then
execstr="$execstr | $GZIP $GZIP_OPTS > $dumpdir/$dbsuffix.ldif.gz"
else
execstr="$execstr > $dumpdir/$dbsuffix.ldif"
fi
debug "$execstr"
output=`su root -s /bin/bash -c "set -o pipefail ; $execstr" 2>&1`
code=$?
if [ "$code" == "0" ]; then
debug "$output"
info "Successfully finished ldif export of $dbsuffix"
else
warning "$output"
warning "Failed ldif export of $dbsuffix"
fi
if [ "$restart" == "yes" ]; then
debug "Starting ldap server..."
/etc/init.d/slapd start
fi
fi
done
fi
return 0
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.