Commit 2e734a8c authored by lavamind's avatar lavamind

New upstream version 1.1.0

parents c16de051 623b777a
......@@ -56,3 +56,12 @@ Jools Wills <jools@oxfordinspire.co.uk> -- Bugfix in the sys helper, indentation
Mark Janssen <mark@sig-io.nl> -- ignore jobs whose filename ends with "~"
shred <riseup@ml.shredzone.de> -- Initial patch for test mode support in the rsync handler
Daniel Lo Nigro <daniel@dan.cx> -- Dropbox support for Duplicity
Matthijs Wensveen <matthijs.wensveen@gmail.com> -- fix symmetric encryption in dup handler
ulrich <ulrich@habmalnefrage.de> -- Added validation check for when
Romain Dessort <romain@univers-libre.net> -- Fix list of devices when dumping partition tables
Guillaume Subiron <ben@wainei.net> -- borg handler
Jerome Charaoui <jerome@riseup.net> -- borg handler
David Gasaway <dave@gasaway.org> -- Fixes for configuration files without suffix
Hugh Nowlan <nosmo@nosmo.me> -- dup check for archive dir
Lyz <lyz@riseup.net> -- sys support for LUKS in disk partitions
Glandos <bugs-0xacab@antipoul.fr> -- sys excludes zram devices
version 1.1.0 -- June 29, 2018
backupninja changes
· Add validation check for when parameter
Thanks to ulrich <ulrich@habmalnefrage.de> for the patch
· Quote output strings passed to logging functions
· Ignore files in /etc/backup.d that lack suffix
Thanks to David Gasaway <dave@gasaway.org> for the patch
· Add Vagrantfile to help with testing/release process
documentation changes
· Fix typos in README.md and manpages. Thank you, Lintian!
· Improve release process documentation
handler changes
borg:
. Add initial support for the borgbackup program
Thanks to Ben <ben@wainei.net> and Thomas Preissler
<thomas@preissler.co.uk> for contributing patches
dup:
· Fix symmetric encryption
Thanks to Matthijs Wensveen <matthijs.wensveen@gmail.com> for
the patch.
· Bail if archive dir doesn't exist
Thanks to Hugh Nowlan <nosmo@nosmo.me> for the patch
sys:
· Use lsblk instead of sfdisk to get a list of block devices
Thanks to Romain Dessort <romain@univers-libre.net> for the patch
· Avoid looking for partitions on zram devices
Thanks to Glandos <bugs-0xacab@antipoul.fr> for the patch
· Support extracting LUKS headers from partitions
Thanks to Lyz <lyz@riseup.net> for the patch.
version 1.0.2 -- September 05, 2017
handler changes
dsync:
......
......@@ -15,7 +15,7 @@ Requirements:
Recommended:
rdiff-backup duplicity rsync gzip hwinfo sfdisk cryptsetup flashrom hwinfo
rdiff-backup duplicity rsync borgbackup gzip hwinfo sfdisk cryptsetup flashrom hwinfo
To install backupninja, simply do the following:
......
# Makefile.in generated by automake 1.15.1 from Makefile.am.
# Makefile.in generated by automake 1.15 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2017 Free Software Foundation, Inc.
# Copyright (C) 1994-2014 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
......@@ -89,7 +89,7 @@ PRE_UNINSTALL = :
POST_UNINSTALL = :
subdir = .
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.in
am__aclocal_m4_deps = $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \
......@@ -496,7 +496,7 @@ distdir: $(DISTFILES)
! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
|| chmod -R a+r "$(distdir)"
dist-gzip: distdir
tardir=$(distdir) && $(am__tar) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).tar.gz
tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
$(am__post_remove_distdir)
dist-bzip2: distdir
......@@ -522,7 +522,7 @@ dist-shar: distdir
@echo WARNING: "Support for shar distribution archives is" \
"deprecated." >&2
@echo WARNING: "It will be removed altogether in Automake 2.0" >&2
shar $(distdir) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).shar.gz
shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
$(am__post_remove_distdir)
dist-zip: distdir
......@@ -540,7 +540,7 @@ dist dist-all:
distcheck: dist
case '$(DIST_ARCHIVES)' in \
*.tar.gz*) \
eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).tar.gz | $(am__untar) ;;\
GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\
*.tar.bz2*) \
bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
*.tar.lz*) \
......@@ -550,7 +550,7 @@ distcheck: dist
*.tar.Z*) \
uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
*.shar.gz*) \
eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\
GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\
*.zip*) \
unzip $(distdir).zip ;;\
esac
......
......@@ -28,12 +28,12 @@ The key features of backupninja are:
The following backup types are supported:
- secure, remote, incremental filesytem backup (via rdiff-backup)
- secure, remote, incremental filesystem backup (via rdiff-backup)
incremental data is compressed. permissions are retained even
with an unpriviledged backup user
- backup of mysql databases (via mysqlhotcopy and mysqldump)
- basic system and hardware info
- encrypted remote backups (via duplicity)
- encrypted remote backups (via duplicity or borgbackup)
- backup of subversion repositories
Installation
......@@ -107,6 +107,7 @@ file in `/etc/backup.d` according to the file's suffix:
- `.sh`: run this file as a shell script.
- `.rdiff`: filesystem backup (using rdiff-backup)
- `.dup`: filesystem backup (using duplicity)
- `.borg`: filesystem backup (using borg)
- `.mysql`: backup mysql databases
- `.pgsql`: backup PostgreSQL databases
- `.sys`: general hardware, partition, and system reports.
......
# generated automatically by aclocal 1.15.1 -*- Autoconf -*-
# generated automatically by aclocal 1.15 -*- Autoconf -*-
# Copyright (C) 1996-2017 Free Software Foundation, Inc.
# Copyright (C) 1996-2014 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
......@@ -20,7 +20,7 @@ You have another version of autoconf. It may work, but is not guaranteed to.
If you have problems, you may need to regenerate the build system entirely.
To do so, use the procedure documented by the package, typically 'autoreconf'.])])
# Copyright (C) 2002-2017 Free Software Foundation, Inc.
# Copyright (C) 2002-2014 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
......@@ -35,7 +35,7 @@ AC_DEFUN([AM_AUTOMAKE_VERSION],
[am__api_version='1.15'
dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
dnl require some minimum version. Point them to the right macro.
m4_if([$1], [1.15.1], [],
m4_if([$1], [1.15], [],
[AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
])
......@@ -51,14 +51,14 @@ m4_define([_AM_AUTOCONF_VERSION], [])
# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
[AM_AUTOMAKE_VERSION([1.15.1])dnl
[AM_AUTOMAKE_VERSION([1.15])dnl
m4_ifndef([AC_AUTOCONF_VERSION],
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
# AM_AUX_DIR_EXPAND -*- Autoconf -*-
# Copyright (C) 2001-2017 Free Software Foundation, Inc.
# Copyright (C) 2001-2014 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
......@@ -110,7 +110,7 @@ am_aux_dir=`cd "$ac_aux_dir" && pwd`
# Do all the work for Automake. -*- Autoconf -*-
# Copyright (C) 1996-2017 Free Software Foundation, Inc.
# Copyright (C) 1996-2014 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
......@@ -307,7 +307,7 @@ for _am_header in $config_headers :; do
done
echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
# Copyright (C) 2001-2017 Free Software Foundation, Inc.
# Copyright (C) 2001-2014 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
......@@ -328,7 +328,7 @@ if test x"${install_sh+set}" != xset; then
fi
AC_SUBST([install_sh])])
# Copyright (C) 2003-2017 Free Software Foundation, Inc.
# Copyright (C) 2003-2014 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
......@@ -349,7 +349,7 @@ AC_SUBST([am__leading_dot])])
# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
# Copyright (C) 1997-2017 Free Software Foundation, Inc.
# Copyright (C) 1997-2014 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
......@@ -388,7 +388,7 @@ fi
# Helper functions for option handling. -*- Autoconf -*-
# Copyright (C) 2001-2017 Free Software Foundation, Inc.
# Copyright (C) 2001-2014 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
......@@ -419,7 +419,7 @@ AC_DEFUN([_AM_IF_OPTION],
# Check to make sure that the build environment is sane. -*- Autoconf -*-
# Copyright (C) 1996-2017 Free Software Foundation, Inc.
# Copyright (C) 1996-2014 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
......@@ -500,7 +500,7 @@ AC_CONFIG_COMMANDS_PRE(
rm -f conftest.file
])
# Copyright (C) 2009-2017 Free Software Foundation, Inc.
# Copyright (C) 2009-2014 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
......@@ -560,7 +560,7 @@ AC_SUBST([AM_BACKSLASH])dnl
_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
])
# Copyright (C) 2001-2017 Free Software Foundation, Inc.
# Copyright (C) 2001-2014 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
......@@ -588,7 +588,7 @@ fi
INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
AC_SUBST([INSTALL_STRIP_PROGRAM])])
# Copyright (C) 2006-2017 Free Software Foundation, Inc.
# Copyright (C) 2006-2014 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
......@@ -607,7 +607,7 @@ AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
# Check how to create a tarball. -*- Autoconf -*-
# Copyright (C) 2004-2017 Free Software Foundation, Inc.
# Copyright (C) 2004-2014 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
......
......@@ -8,10 +8,10 @@ fi
if [ "x$1" = "x-f" ]
then
autoscan
[ -f "configure.in" ] && cp "configure.in" "configure.in.old"
mv -f "configure.scan" "configure.in"
echo "## This is just AUTOSCAN draft of configure.in"
$EDITOR "configure.in"
[ -f "configure.ac" ] && cp "configure.ac" "configure.ac.old"
mv -f "configure.scan" "configure.ac"
echo "## This is just AUTOSCAN draft of configure.ac"
$EDITOR "configure.ac"
fi
### použít jen když je třeba použít configure.h.in
......
%define name backupninja
%define version 1.0.2
%define version 1.1.0
Summary: Backupninja backup tool
Name: %{name}
......
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69 for backupninja 1.0.2.
# Generated by GNU Autoconf 2.69 for backupninja 1.1.0.
#
# Report bugs to <backupninja@lists.riseup.net>.
#
......@@ -579,8 +579,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='backupninja'
PACKAGE_TARNAME='backupninja'
PACKAGE_VERSION='1.0.2'
PACKAGE_STRING='backupninja 1.0.2'
PACKAGE_VERSION='1.1.0'
PACKAGE_STRING='backupninja 1.1.0'
PACKAGE_BUGREPORT='backupninja@lists.riseup.net'
PACKAGE_URL=''
......@@ -1219,7 +1219,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures backupninja 1.0.2 to adapt to many kinds of systems.
\`configure' configures backupninja 1.1.0 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
......@@ -1286,7 +1286,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of backupninja 1.0.2:";;
short | recursive ) echo "Configuration of backupninja 1.1.0:";;
esac
cat <<\_ACEOF
......@@ -1360,7 +1360,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
backupninja configure 1.0.2
backupninja configure 1.1.0
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
......@@ -1377,7 +1377,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by backupninja $as_me 1.0.2, which was
It was created by backupninja $as_me 1.1.0, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
......@@ -2241,7 +2241,7 @@ fi
# Define the identity of the package.
PACKAGE='backupninja'
VERSION='1.0.2'
VERSION='1.1.0'
cat >>confdefs.h <<_ACEOF
......@@ -3276,7 +3276,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by backupninja $as_me 1.0.2, which was
This file was extended by backupninja $as_me 1.1.0, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
......@@ -3329,7 +3329,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
backupninja config.status 1.0.2
backupninja config.status 1.1.0
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
......
......@@ -3,7 +3,7 @@
# The maintainer mode is causing me grief with newest versions of autotools
#AM_MAINTAINER_MODE
AC_INIT([backupninja],[1.0.2],[backupninja@lists.riseup.net])
AC_INIT([backupninja],[1.1.0],[backupninja@lists.riseup.net])
AC_CONFIG_SRCDIR([src/backupninja.in])
AM_INIT_AUTOMAKE([foreign])
......
# Makefile.in generated by automake 1.15.1 from Makefile.am.
# Makefile.in generated by automake 1.15 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2017 Free Software Foundation, Inc.
# Copyright (C) 1994-2014 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
......@@ -88,7 +88,7 @@ PRE_UNINSTALL = :
POST_UNINSTALL = :
subdir = etc
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.in
am__aclocal_m4_deps = $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
......
EXAMPLES = example.dup example.maildir example.makecd example.mysql \
example.pgsql example.rdiff example.rsync example.sh \
example.svn example.sys example.trac
EXAMPLES = example.borg example.dup example.maildir example.makecd \
example.mysql example.pgsql example.rdiff example.rsync \
example.sh example.svn example.sys example.trac
EXTRA_DIST = $(EXAMPLES)
......
# Makefile.in generated by automake 1.15.1 from Makefile.am.
# Makefile.in generated by automake 1.15 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2017 Free Software Foundation, Inc.
# Copyright (C) 1994-2014 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
......@@ -88,7 +88,7 @@ PRE_UNINSTALL = :
POST_UNINSTALL = :
subdir = examples
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.in
am__aclocal_m4_deps = $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(dist_pkgdata_DATA) \
......@@ -229,9 +229,9 @@ target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
EXAMPLES = example.dup example.maildir example.makecd example.mysql \
example.pgsql example.rdiff example.rsync example.sh \
example.svn example.sys example.trac
EXAMPLES = example.borg example.dup example.maildir example.makecd \
example.mysql example.pgsql example.rdiff example.rsync \
example.sh example.svn example.sys example.trac
EXTRA_DIST = $(EXAMPLES)
dist_pkgdata_DATA = $(EXAMPLES)
......
##
## This is an example borgbackup configuration file.
##
## Here you can find all the possible borgbackup options, details of
## what the options provide and possible settings. The defaults are set
## as the commented out option, uncomment and change when
## necessary. Options which are uncommented in this example do not have
## defaults, and the settings provided are recommended.
##
## The defaults are useful in most cases, just make sure to configure the
## destination host and user.
##
## default is 0, but set to 19 if you want to lower the priority.
## an example setting would be:
## nicelevel = 19
##
## Default
# nicelevel = 0
## default is yes. set to no to skip the test if the remote host is alive
##
## Default:
# testconnect = yes
## default is not to limit bandwidth.
## set to a number in kiBytes/second to limit bandwidth usage.
##
## Default:
# bwlimit = 0
######################################################
## source section
## (where the files to be backed up are coming from)
[source]
## default is to initialize the backup repository if absent
## set to no to skip this step
##
## Default:
# init = yes
## A few notes about includes and excludes:
## 1. include paths do not support any kind of pattern matching
## 2. exclude paths support several types of pattern matching, the default being
## shell-style matching, where, for example, '*' matches any number of
## characters. for more info, see : borg help patterns
## 3. Symlinks are preserved (not followed).
##
## for more info see : borg help patterns
##
## files to include in the backup
include = /opt
include = /srv
include = /etc
include = /root
include = /home
include = /usr/local
include = /var
## files to exclude from the backup
exclude = /var/lock
exclude = /var/run
exclude = /var/cache
exclude = /var/tmp
exclude = /var/lib/mongodb/journal
exclude = /var/lib/clamav
exclude = /var/lib/mlocate
exclude = /var/lib/postgresql
exclude = /var/lib/mysql
## define extra command-line options for the "borg create" operation.
##
## Example:
## create_options = --exclude-caches
##
## for more info see : borg help create
##
## Default:
# create_options =
## whether to prune (remove) older backups
##
## Default:
# prune = yes
## keep all backups within this time frame.
## must be defined as a number followed by one of the
## following characters: "H", "d", "w", "m", "y"
##
## this option will be ignored if set to 0
##
## the default is to keep all backups made within the
## last 30 days
##
## Default:
# keep = 30d
## define extra command-line options for the "borg prune" operation.
##
## Example:
## prune_options = --keep-daily=7 --keep-weekly=4 --keep-monthly=6
##
## for more info see : borg help prune
##
## Default:
# prune_options =
######################################################
## destination section
## (where the files are copied to)
[dest]
## put the backups under this directory, this must be set!
## an example setting would be:
## directory = /backups
##
## Default:
# directory =
## the machine which will receive the backups.
## an example setting would be:
## host = backuphost
##
## set host = localhost for local backups (no ssh)
##
## Default
# host =
## make the files owned by this user. you must be able to
## `su -c "ssh backupuser@backhost"` without specifying a password.
## an example setting would be:
## user = backupuser
##
## Default:
# user =
## archive name, should be unique every day.
## Format tags available :
## {now}, {utcnow}, {fqdn}, {hostname}, {user}, {pid}
##
## for more info see : borg help create
##
## Default:
# archive = {now:%Y-%m-%dT%H:%M:%S}
## compression algorithm
## can be "none", "lz4", "zstd[,L]", "zlib[,L]", "lzma[,L]", "auto,C[,L]".
## - "none" stands for "no compression"
## - "lz4" offers very high speed, very low compression
## - "zstd" is a modern wide-range algorithm
## - "zlib" offers medium speed, medium compression
## - "lzma" offers low speed, high compression
## - "auto,C" will use a heuristic to decide whether to compress using
## selected algorithm C
##
## for more info see : borg help compression
##
## Default:
# compression = lz4
## encryption mode to use for repository creation
##
## common options are "none", "repokey" or "keyfile"
## - "none" = no encryption
## - "repokey" = encryption with key stored inside the repository
## - "keyfile" = encryption with key stored in ~/.config/borg/keys/
##
## for other options and more info, see : borg help init
##
## Default:
# encryption = none
## passphrase of the key used for repository encryptions
##
## must be set if encryption is not "none"
## encryption is disabled by default
##
## Default:
# passphrase =
HANDLERS = dup dup.helper maildir makecd \
HANDLERS = borg borg.helper dup dup.helper maildir makecd \
makecd.helper mysql mysql.helper pgsql pgsql.helper rdiff \
rdiff.helper rsync sh svn sys sys.helper trac tar tar.helper
DIST_HANDLERS = dup.in dup.helper.in maildir.in makecd.in \
DIST_HANDLERS = borg.in borg.helper.in dup.in dup.helper.in maildir.in makecd.in \
makecd.helper.in mysql.in mysql.helper.in pgsql.in pgsql.helper.in rdiff.in \
rdiff.helper.in rsync.in sh.in svn.in sys.in sys.helper.in trac.in tar.in tar.helper.in wget
......@@ -18,6 +18,14 @@ edit = sed \
pkgdata_DATA = $(HANDLERS)
borg: $(srcdir)/borg.in
rm -f borg
$(edit) $(srcdir)/borg.in > borg
borg.helper: $(srcdir)/borg.helper.in
rm -f borg.helper
$(edit) $(srcdir)/borg.helper.in > borg.helper
dup: $(srcdir)/dup.in
rm -f dup
$(edit) $(srcdir)/dup.in > dup
......
# Makefile.in generated by automake 1.15.1 from Makefile.am.
# Makefile.in generated by automake 1.15 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2017 Free Software Foundation, Inc.
# Copyright (C) 1994-2014 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
......@@ -88,7 +88,7 @@ PRE_UNINSTALL = :
POST_UNINSTALL = :
subdir = handlers
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.in
am__aclocal_m4_deps = $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
......@@ -228,11 +228,11 @@ target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
HANDLERS = dup dup.helper maildir makecd \
HANDLERS = borg borg.helper dup dup.helper maildir makecd \
makecd.helper mysql mysql.helper pgsql pgsql.helper rdiff \
rdiff.helper rsync sh svn sys sys.helper trac tar tar.helper
DIST_HANDLERS = dup.in dup.helper.in maildir.in makecd.in \
DIST_HANDLERS = borg.in borg.helper.in dup.in dup.helper.in maildir.in makecd.in \
makecd.helper.in mysql.in mysql.helper.in pgsql.in pgsql.helper.in rdiff.in \
rdiff.helper.in rsync.in sh.in svn.in sys.in sys.helper.in trac.in tar.in tar.helper.in wget
......@@ -455,6 +455,14 @@ uninstall-am: uninstall-pkgdataDATA
.PRECIOUS: Makefile
borg: $(srcdir)/borg.in
rm -f borg
$(edit) $(srcdir)/borg.in > borg
borg.helper: $(srcdir)/borg.helper.in
rm -f borg.helper
$(edit) $(srcdir)/borg.helper.in > borg.helper
dup: $(srcdir)/dup.in
rm -f dup
$(edit) $(srcdir)/dup.in > dup
......
This diff is collapsed.
# -*- mode: sh; sh-basic-offset: 3; indent-tabs-mode: nil; -*-
# vim: set filetype=sh sw=3 sts=3 expandtab autoindent:
#
# borg handler script for backupninja
# requires borgbackup
#
# Guillaume Subiron, Sysnove, 2016
#
# Copyright 2016 Guillaume Subiron <guillaume@sysnove.fr>
#
# This work is free. You can redistribute it and/or modify it under the
# terms of the Do What The Fuck You Want To Public License, Version 2,
# as published by Sam Hocevar. See the http://www.wtfpl.net/ file for more details.
#
#
export BORG_RELOCATED_REPO_ACCESS_IS_OK=yes
export BORG_UNKNOWN_UNENCRYPTED_REPO_ACCESS_IS_OK=yes
### GET CONFIG ###
getconf testconnect yes
getconf nicelevel 0
getconf bwlimit
setsection source
getconf init yes
getconf include
getconf exclude
getconf create_options
getconf prune yes
getconf keep 30d
getconf prune_options
setsection dest
getconf user
getconf host
getconf directory
# strip trailing /
directory=${directory%/}
getconf archive {now:%Y-%m-%dT%H:%M:%S}
getconf compression lz4
getconf encryption none
getconf passphrase
export BORG_PASSPHRASE="$passphrase"
### CHECK CONFIG ###
# destination specific checks
[ "$directory" != "" ] || fatal "Destination directory not set"
if [ "$host" != "localhost" ]; then
execstr_repository="ssh://${user}@${host}${directory}"
else
execstr_repository="$directory"
fi
execstr_archive="$archive"
# check the connection at the source and destination
[ -n "$test" ] || test=0
if [ "$host" != "localhost" ] && ([ "$testconnect" = "yes" ] || [ "${test}" -eq 1 ]); then
debug "ssh -o PasswordAuthentication=no $host -l $user 'echo -n 1'"
local ret=`ssh -o PasswordAuthentication=no $host -l $user 'echo -n 1'`
if [ "$ret" = 1 ]; then
debug "Connected to $host as $user successfully"
else
teststr="borg list --show-rc -v $execstr_repository"
debug "$teststr"
output=`su -c "$teststr" 2>&1`
if echo "$output" | grep "terminating with success status" ; then
debug "Connected to $host as $user successfully (forced command)"
else
if echo "$output" | grep -E "Repository.+does not exist" ; then
debug "Connected to $host as $user successfully (forced command)"
else
fatal "Can't connect to $host as $user."
fi
fi
fi
fi
### INIT IF NEEDED ###
if [ "$init" == "yes" ]; then
initstr="borg init --encryption=$encryption $execstr_repository"
debug "$initstr"