backupninja-1.1.0/0000755000175000017500000000000013315454014010777 500000000000000backupninja-1.1.0/aclocal.m40000644000175000017500000006525313315454012012570 00000000000000# generated automatically by aclocal 1.15 -*- Autoconf -*- # 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, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],, [m4_warning([this file was generated for autoconf 2.69. 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-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_AUTOMAKE_VERSION(VERSION) # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been # generated from the m4 files accompanying Automake X.Y. # (This private macro should not be called outside this file.) 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], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) # _AM_AUTOCONF_VERSION(VERSION) # ----------------------------- # aclocal traces this macro to find the Autoconf version. # This is a private macro too. Using m4_define simplifies # the logic in aclocal, which can simply ignore this definition. m4_define([_AM_AUTOCONF_VERSION], []) # AM_SET_CURRENT_AUTOMAKE_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])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-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets # $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to # '$srcdir', '$srcdir/..', or '$srcdir/../..'. # # Of course, Automake must honor this variable whenever it calls a # tool from the auxiliary directory. The problem is that $srcdir (and # therefore $ac_aux_dir as well) can be either absolute or relative, # depending on how configure is run. This is pretty annoying, since # it makes $ac_aux_dir quite unusable in subdirectories: in the top # source directory, any form will work fine, but in subdirectories a # relative path needs to be adjusted first. # # $ac_aux_dir/missing # fails when called from a subdirectory if $ac_aux_dir is relative # $top_srcdir/$ac_aux_dir/missing # fails if $ac_aux_dir is absolute, # fails when called from a subdirectory in a VPATH build with # a relative $ac_aux_dir # # The reason of the latter failure is that $top_srcdir and $ac_aux_dir # are both prefixed by $srcdir. In an in-source build this is usually # harmless because $srcdir is '.', but things will broke when you # start a VPATH build or use an absolute $srcdir. # # So we could use something similar to $top_srcdir/$ac_aux_dir/missing, # iff we strip the leading $srcdir from $ac_aux_dir. That would be: # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` # and then we would define $MISSING as # MISSING="\${SHELL} $am_aux_dir/missing" # This will work as long as MISSING is not called from configure, because # unfortunately $(top_srcdir) has no meaning in configure. # However there are other variables, like CC, which are often used in # configure, and could therefore not use this "fixed" $ac_aux_dir. # # Another solution, used here, is to always expand $ac_aux_dir to an # absolute PATH. The drawback is that using absolute paths prevent a # configured tree to be moved without reconfiguration. AC_DEFUN([AM_AUX_DIR_EXPAND], [AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl # Expand $ac_aux_dir to an absolute path. am_aux_dir=`cd "$ac_aux_dir" && pwd` ]) # Do all the work for Automake. -*- Autoconf -*- # 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, # with or without modifications, as long as this notice is preserved. # This macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O. m4_define([AC_PROG_CC], m4_defn([AC_PROG_CC]) [_AM_PROG_CC_C_O ]) # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) # AM_INIT_AUTOMAKE([OPTIONS]) # ----------------------------------------------- # The call with PACKAGE and VERSION arguments is the old style # call (pre autoconf-2.50), which is being phased out. PACKAGE # and VERSION should now be passed to AC_INIT and removed from # the call to AM_INIT_AUTOMAKE. # We support both call styles for the transition. After # the next Automake release, Autoconf can make the AC_INIT # arguments mandatory, and then we can depend on a new Autoconf # release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.65])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl # test to see if srcdir already configured if test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi AC_SUBST([CYGPATH_W]) # Define the identity of the package. dnl Distinguish between old-style and new-style calls. m4_ifval([$2], [AC_DIAGNOSE([obsolete], [$0: two- and three-arguments forms are deprecated.]) m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl AC_SUBST([PACKAGE], [$1])dnl AC_SUBST([VERSION], [$2])], [_AM_SET_OPTIONS([$1])dnl dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. m4_if( m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]), [ok:ok],, [m4_fatal([AC_INIT should be called with package and version arguments])])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl _AM_IF_OPTION([no-define],, [AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package]) AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl # Some tools Automake needs. AC_REQUIRE([AM_SANITY_CHECK])dnl AC_REQUIRE([AC_ARG_PROGRAM])dnl AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}]) AM_MISSING_PROG([AUTOCONF], [autoconf]) AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}]) AM_MISSING_PROG([AUTOHEADER], [autoheader]) AM_MISSING_PROG([MAKEINFO], [makeinfo]) AC_REQUIRE([AM_PROG_INSTALL_SH])dnl AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl AC_REQUIRE([AC_PROG_MKDIR_P])dnl # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: # # AC_SUBST([mkdir_p], ['$(MKDIR_P)']) # We need awk for the "check" target (and possibly the TAP driver). The # system "awk" is bad on some platforms. AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AM_SET_LEADING_DOT])dnl _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], [_AM_PROG_TAR([v7])])]) _AM_IF_OPTION([no-dependencies],, [AC_PROVIDE_IFELSE([AC_PROG_CC], [_AM_DEPENDENCIES([CC])], [m4_define([AC_PROG_CC], m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl AC_PROVIDE_IFELSE([AC_PROG_CXX], [_AM_DEPENDENCIES([CXX])], [m4_define([AC_PROG_CXX], m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJC], [_AM_DEPENDENCIES([OBJC])], [m4_define([AC_PROG_OBJC], m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJCXX], [_AM_DEPENDENCIES([OBJCXX])], [m4_define([AC_PROG_OBJCXX], m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl ]) AC_REQUIRE([AM_SILENT_RULES])dnl dnl The testsuite driver may need to know about EXEEXT, so add the dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below. AC_CONFIG_COMMANDS_PRE(dnl [m4_provide_if([_AM_COMPILER_EXEEXT], [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl # POSIX will say in a future version that running "rm -f" with no argument # is OK; and we want to be able to make that assumption in our Makefile # recipes. So use an aggressive probe to check that the usage we want is # actually supported "in the wild" to an acceptable degree. # See automake bug#10828. # To make any issue more visible, cause the running configure to be aborted # by default if the 'rm' program in use doesn't match our expectations; the # user can still override this though. if rm -f && rm -fr && rm -rf; then : OK; else cat >&2 <<'END' Oops! Your 'rm' program seems unable to run without file operands specified on the command line, even when the '-f' option is present. This is contrary to the behaviour of most rm programs out there, and not conforming with the upcoming POSIX standard: Please tell bug-automake@gnu.org about your system, including the value of your $PATH and any error possibly output before this message. This can help us improve future automake versions. END if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then echo 'Configuration will proceed anyway, since you have set the' >&2 echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 echo >&2 else cat >&2 <<'END' Aborting the configuration process, to ensure you take notice of the issue. You can download and install GNU coreutils to get an 'rm' implementation that behaves properly: . If you want to complete the configuration process using your problematic 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM to "yes", and re-run configure. END AC_MSG_ERROR([Your 'rm' program is bad, sorry.]) fi fi dnl The trailing newline in this macro's definition is deliberate, for dnl backward compatibility and to allow trailing 'dnl'-style comments dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841. ]) dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further dnl mangled by Autoconf and run in a shell conditional statement. m4_define([_AC_COMPILER_EXEEXT], m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) # When config.status generates a header, we must update the stamp-h file. # This file resides in the same directory as the config header # that is generated. The stamp files are numbered to have different names. # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the # loop where config.status creates the headers, so we can generate # our stamp files there. AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers. _am_arg=$1 _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) # 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, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl if test x"${install_sh+set}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi AC_SUBST([install_sh])]) # 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, # with or without modifications, as long as this notice is preserved. # Check whether the underlying file-system supports filenames # with a leading dot. For instance MS-DOS doesn't. AC_DEFUN([AM_SET_LEADING_DOT], [rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null AC_SUBST([am__leading_dot])]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- # 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, # with or without modifications, as long as this notice is preserved. # AM_MISSING_PROG(NAME, PROGRAM) # ------------------------------ AC_DEFUN([AM_MISSING_PROG], [AC_REQUIRE([AM_MISSING_HAS_RUN]) $1=${$1-"${am_missing_run}$2"} AC_SUBST($1)]) # AM_MISSING_HAS_RUN # ------------------ # Define MISSING if not defined so far and test if it is modern enough. # If it is, set am_missing_run to use it, otherwise, to nothing. AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([missing])dnl if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then am_missing_run="$MISSING " else am_missing_run= AC_MSG_WARN(['missing' script is too old or missing]) fi ]) # Helper functions for option handling. -*- Autoconf -*- # 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, # with or without modifications, as long as this notice is preserved. # _AM_MANGLE_OPTION(NAME) # ----------------------- AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) # _AM_SET_OPTION(NAME) # -------------------- # Set option NAME. Presently that only means defining a flag for this option. AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), [1])]) # _AM_SET_OPTIONS(OPTIONS) # ------------------------ # OPTIONS is a space-separated list of Automake options. AC_DEFUN([_AM_SET_OPTIONS], [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) # ------------------------------------------- # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) # Check to make sure that the build environment is sane. -*- Autoconf -*- # 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, # with or without modifications, as long as this notice is preserved. # AM_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[[\\\"\#\$\&\'\`$am_lf]]*) AC_MSG_ERROR([unsafe absolute working directory name]);; esac case $srcdir in *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);; esac # Do 'set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( am_has_slept=no for am_try in 1 2; do echo "timestamp, slept: $am_has_slept" > conftest.file set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$[*]" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi if test "$[*]" != "X $srcdir/configure conftest.file" \ && test "$[*]" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken alias in your environment]) fi if test "$[2]" = conftest.file || test $am_try -eq 2; then break fi # Just in case. sleep 1 am_has_slept=yes done test "$[2]" = conftest.file ) then # Ok. : else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi AC_MSG_RESULT([yes]) # If we didn't sleep, we still need to ensure time stamps of config.status and # generated files are strictly newer. am_sleep_pid= if grep 'slept: no' conftest.file >/dev/null 2>&1; then ( sleep 1 ) & am_sleep_pid=$! fi AC_CONFIG_COMMANDS_PRE( [AC_MSG_CHECKING([that generated files are newer than configure]) if test -n "$am_sleep_pid"; then # Hide warnings about reused PIDs. wait $am_sleep_pid 2>/dev/null fi AC_MSG_RESULT([done])]) rm -f conftest.file ]) # 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, # with or without modifications, as long as this notice is preserved. # AM_SILENT_RULES([DEFAULT]) # -------------------------- # Enable less verbose build rules; with the default set to DEFAULT # ("yes" being less verbose, "no" or empty being verbose). AC_DEFUN([AM_SILENT_RULES], [AC_ARG_ENABLE([silent-rules], [dnl AS_HELP_STRING( [--enable-silent-rules], [less verbose build output (undo: "make V=1")]) AS_HELP_STRING( [--disable-silent-rules], [verbose build output (undo: "make V=0")])dnl ]) case $enable_silent_rules in @%:@ ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; esac dnl dnl A few 'make' implementations (e.g., NonStop OS and NextStep) dnl do not support nested variable expansions. dnl See automake bug#9928 and bug#10237. am_make=${MAKE-make} AC_CACHE_CHECK([whether $am_make supports nested variables], [am_cv_make_support_nested_variables], [if AS_ECHO([['TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi]) if test $am_cv_make_support_nested_variables = yes; then dnl Using '$V' instead of '$(V)' breaks IRIX make. AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AC_SUBST([AM_V])dnl AM_SUBST_NOTMAKE([AM_V])dnl AC_SUBST([AM_DEFAULT_V])dnl AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl AC_SUBST([AM_DEFAULT_VERBOSITY])dnl AM_BACKSLASH='\' AC_SUBST([AM_BACKSLASH])dnl _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl ]) # 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, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_STRIP # --------------------- # One issue with vendor 'install' (even GNU) is that you can't # specify the program used to strip binaries. This is especially # annoying in cross-compiling environments, where the build's strip # is unlikely to handle the host's binaries. # Fortunately install-sh will honor a STRIPPROG variable, so we # always use install-sh in "make install-strip", and initialize # STRIPPROG with the value of the STRIP variable (set by the user). AC_DEFUN([AM_PROG_INSTALL_STRIP], [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl # Installed binaries are usually stripped using 'strip' when the user # run "make install-strip". However 'strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the 'STRIP' environment variable to overrule this program. dnl Don't test for $cross_compiling = yes, because it might be 'maybe'. if test "$cross_compiling" != no; then AC_CHECK_TOOL([STRIP], [strip], :) fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) # 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, # with or without modifications, as long as this notice is preserved. # _AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. # This macro is traced by Automake. AC_DEFUN([_AM_SUBST_NOTMAKE]) # AM_SUBST_NOTMAKE(VARIABLE) # -------------------------- # Public sister of _AM_SUBST_NOTMAKE. AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # Check how to create a tarball. -*- Autoconf -*- # 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, # with or without modifications, as long as this notice is preserved. # _AM_PROG_TAR(FORMAT) # -------------------- # Check how to create a tarball in format FORMAT. # FORMAT should be one of 'v7', 'ustar', or 'pax'. # # Substitute a variable $(am__tar) that is a command # writing to stdout a FORMAT-tarball containing the directory # $tardir. # tardir=directory && $(am__tar) > result.tar # # Substitute a variable $(am__untar) that extract such # a tarball read from stdin. # $(am__untar) < result.tar # AC_DEFUN([_AM_PROG_TAR], [# Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AC_SUBST([AMTAR], ['$${TAR-tar}']) # We'll loop over all known methods to create a tar archive until one works. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' m4_if([$1], [v7], [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], [m4_case([$1], [ustar], [# The POSIX 1988 'ustar' format is defined with fixed-size fields. # There is notably a 21 bits limit for the UID and the GID. In fact, # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343 # and bug#13588). am_max_uid=2097151 # 2^21 - 1 am_max_gid=$am_max_uid # The $UID and $GID variables are not portable, so we need to resort # to the POSIX-mandated id(1) utility. Errors in the 'id' calls # below are definitely unexpected, so allow the users to see them # (that is, avoid stderr redirection). am_uid=`id -u || echo unknown` am_gid=`id -g || echo unknown` AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format]) if test $am_uid -le $am_max_uid; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) _am_tools=none fi AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format]) if test $am_gid -le $am_max_gid; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) _am_tools=none fi], [pax], [], [m4_fatal([Unknown tar format])]) AC_MSG_CHECKING([how to create a $1 tar archive]) # Go ahead even if we have the value already cached. We do so because we # need to set the values for the 'am__tar' and 'am__untar' variables. _am_tools=${am_cv_prog_tar_$1-$_am_tools} for _am_tool in $_am_tools; do case $_am_tool in gnutar) for _am_tar in tar gnutar gtar; do AM_RUN_LOG([$_am_tar --version]) && break done am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' am__untar="$_am_tar -xf -" ;; plaintar) # Must skip GNU tar: if it does not support --format= it doesn't create # ustar tarball either. (tar --version) >/dev/null 2>&1 && continue am__tar='tar chf - "$$tardir"' am__tar_='tar chf - "$tardir"' am__untar='tar xf -' ;; pax) am__tar='pax -L -x $1 -w "$$tardir"' am__tar_='pax -L -x $1 -w "$tardir"' am__untar='pax -r' ;; cpio) am__tar='find "$$tardir" -print | cpio -o -H $1 -L' am__tar_='find "$tardir" -print | cpio -o -H $1 -L' am__untar='cpio -i -H $1 -d' ;; none) am__tar=false am__tar_=false am__untar=false ;; esac # If the value was cached, stop now. We just wanted to have am__tar # and am__untar set. test -n "${am_cv_prog_tar_$1}" && break # tar/untar a dummy directory, and stop if the command works. rm -rf conftest.dir mkdir conftest.dir echo GrepMe > conftest.dir/file AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) rm -rf conftest.dir if test -s conftest.tar; then AM_RUN_LOG([$am__untar /dev/null 2>&1 && break fi done rm -rf conftest.dir AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) AC_MSG_RESULT([$am_cv_prog_tar_$1])]) AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR backupninja-1.1.0/TODO0000644000175000017500000000205313230423112011376 00000000000000 This is a todo list, want to help? Pick something and let the list know you are working on it! . Fix all bugs reported on the Debian BTS: http://bugs.debian.org/cgi-bin/pkgreport.cgi?which=pkg&data=backupninja&archive=no . Fix all bugs reported on our Gitlab instance: https://0xacab.org/riseuplabs/backupninja/issues . Make ninjahelper allow you to pick what type of backup you want (instead of just assuming you want local-to-remote, or push backups. Some people want local-to-local, or remote-to-local, or pull backups). This has been reported for the duplicity handler as Debian bug #346040. . Allow vsnames "all" in the msyql handler. . Factorize the rdiff.helper's connection-related functions into a lib, so that they can be used by dup.helper too. (NB: don't forget that the dup handler has a sshoptions configuration setting, that is often used to specify an alternative SSH key, or a specific IP to bind to.) . Add an exclude option to database handlers so you can configure it to backup all databases, except for the excluded ones backupninja-1.1.0/ChangeLog0000644000175000017500000011746213315453712012510 00000000000000version 1.1.0 -- June 29, 2018 backupninja changes · Add validation check for when parameter Thanks to ulrich for the patch · Quote output strings passed to logging functions · Ignore files in /etc/backup.d that lack suffix Thanks to David Gasaway 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 and Thomas Preissler for contributing patches dup: · Fix symmetric encryption Thanks to Matthijs Wensveen for the patch. · Bail if archive dir doesn't exist Thanks to Hugh Nowlan for the patch sys: · Use lsblk instead of sfdisk to get a list of block devices Thanks to Romain Dessort for the patch · Avoid looking for partitions on zram devices Thanks to Glandos for the patch · Support extracting LUKS headers from partitions Thanks to Lyz for the patch. version 1.0.2 -- September 05, 2017 handler changes dsync: . Miscellaneous improvements to this experimental handler. dup: . For local backups, check that the destination directory exists. Thanks to ulrich for the preliminary patch. (Redmine#4049) . Gracefully handle legacy spaces between -o and IdentityFile. . Don't remove useful signature files with --extra-clean, on duplicity versions that have a sane handling of the cache. Thanks to Alexander Mette for the patch! (Closes: Redmine#6357) . Fix buggy version comparison. (Redmine#6746) . Support using a different passphrase for the signing key from the one used for the encryption key (Closes: #726072). Thanks to Dominik George for the patch! · Run duplicity in a C locales environment (Closes: #736280). Thanks to Jonathan Dupart for the report, and the initial patch! . Fix handling of Dropbox access token (Closes: GitLab#11260). mysql: . Make "nodata" option compatible with compress=no. . Fix non-qualified table name extraction. (Closes: Redmine#4373) . Skip dumping information and performance_schema databasase. (Closes: GitLab#11148) rdiff: . Add option to include rdiff-backup output in reports. Thanks to David Gasaway for the patch! rsync: . Solve quoting issue with "su". (Closes: #683731, Redmine#4019) . Update increment folder date to avoid ending up with contradictory information. (Closes: Redmine#3929) . Force rsync handler run bash at the remote destination. (Closes: Redmine#3003) . Support running in test mode (Closes: Redmine#8196). Thanks to shred for the initial patch. sys: . Fix LUKS header backup to properly detect partitions. . Provide the ability to backup the MBR for every device found, and to backup the BIOS (if the flashrom program is installed, and the mainboard is supported). . Add suse to the list of supported OS (Redmine#7101). Thanks to Christian Prause for the patch. . Fix indentation. Thanks to Jools Wills for the patch. (Closes: Redmine#6802) . Exclude tmpfs filesystems from df output. (Closes: Debian#745818) tar: . Support test mode and xz compression. Thanks to Pierre ROUDIER for the patches. helper changes rdiff: . Don't give misleading information regarding required fields. (Redmine#4410) . Support output_as_info. Thanks to David Gasaway for the patch! sys: . Remove spurious quotes that broke the helper (Closes: Redmine#6803). Thanks to Jools Wills for the patch. backupninja changes . Indentation fixes, thanks to exobuzz. (Redmine#6726) . Ignore jobs whose filename ends with "~". Thanks to Mark Janssen for the patch. build system changes · Pass the "foreign" option to AM_INIT_AUTOMAKE: README has been renamed to README.md. documentation changes . Update INSTALL file to add some missing recommended programs. . Document release process. . Merge FAQ content from the Redmine wiki into the one shipped with backupninja. . README.md: reorganize, reformat, and point to the examples configuration files. . INSTALL.md: recommend using packages on Debian and derivatives. . bandwidthlimit for the dup handler needs to be given in KB/s, and not (as wrongly advertised previously) in Kbit/s. (Closes: GitLab#7603) version 1.0.1 -- June 29, 2012 handler changes rsync: . Issue warnings, not fatal errors, on non-fatal rsync errors. (Redmine#3966) version 1.0 -- June 15, 2012 The "happy birthdays" release! handler changes mysql: . Use --skip-events when backing up the performance_schema database. (Closes: #673572) rsync: . Generate excludes command-line snippet the same way as the duplicity handler does. . Run rsync command-line through a shell, so that single-quotes around excludes are interpreted (Closes: #677410) sys: . Don't execute /usr/bin/lspci or /sbin/modinfo when $hardware == "no" backupninja changes . Make it clear what lockfile could not be acquired, if any. version 1.0-rc1 -- May 15, 2012 handler changes dup: . Make the .dup generated by ninjahelper more consistent with example.dup. . Add support for RackSpace's CloudFiles. Thanks to Yuval Kogman for the patch. . Adapt for new duplicity SSH backend. Support bandwidthlimit with new duplicity, using trickle. (Closes: #657201) . Report failure output at error loglevel so that it is emailed (Closes: #536858) maildir: . Remove 'loadlimit' parameter - it is not used anywhere. mysql: . Don't attempt to dump performance_schema database (Redmine#3741). pgsql: . Don't produce empty uncompressed backups (Redmine#3820). rdiff-backup: . Use fatal function to report failure of rdiff-backup jobs as such. rysnc: . Fix numericids option (Redmine#3691). . Mangle $rsync_options just afterwards (Redmine#3702, Redmine#3001). . Fix metadata rotation. . Allow disabling rotation or setting 2 days as minimum for backup increments in rsync short format (Redmine#2107). . Abort on rsync error (Redmine#3692). . Cleanup orphaned metadata (Redmine#3727). . Use the backup start time and not the time the backup was finished. (Closes: #654192). . Use 'debug', 'fatal' and 'warning' functions instead of regular echo and exit (Redmine#3840, Redmine#3721). . Quoting $starttime (Redmine#3868). . Validate created date on long_rotation to avoid too many arguments at comparison (Redmine#3868). . Quoting $exclude and $excludes and avoiding a for loop on $exclude to not expand wildcards in beforehand (Redmine#3882). . Quote excludes (Redmine#3882). . Changing remaining 'exit' to 'fatal' at rsync handler (Redmine#3721). . Removing duplicated locking support (Redmine#3838). . Documenting rotation parameters at example.rsync (Redmine#3891). . Ensure that a non-zero rsync exit status is caught (Redmine#3892). build system changes . Workaround automake sanity check that would prevent us from installing lib/* into lib/backupninja/. Where else are be supposed to install such files anyway? . Have "make dist" ship handlers/*.in instead of make results. . Have "make dist" ship the FAQ. . Install handlers as pkgdata_DATA, instead of their .in files. documentation changes . Document what features available to .sh jobs (Redmine #1558). version 0.9.10 -- September 23, 2011 backupninja changes . Fix email reports, that were broken by the new locking support. handler changes dup: . Cleanup: stop supporting duplicity < 0.6.01 (Redmine#2538). . Fix incorrect duplicity version check for keepincroffulls. Thanks to Olivier Berger for the patch. (Closes Redmine bug #3443) (Closes: #641120) ldap: . Don't install LDAP handler, helper and example configuration file. Don't mention LDAP support in documentation. Official LDAP support will come back once this code has found itself a maintainer. Interested? Get in touch! rsync: . Fixing $rsync_options output when rsync is local (Closes Redmine bug #3001) (Closes: #639545) sh: . Allow 'when = XXX' with spaces (Redmine#2769). Thanks to aihtdikh for the patch. sys: . Remove useless and inconsistent executable bit on handler. helper changes rdiff: . Fix infinite loop when version inconsistency is detected. Thanks to Chris Lamb for the patch. (Closes: #639547) version 0.9.9 -- May 15, 2011 backupninja changes . Use locking to avoid running concurrent instances of the same backup action. Thanks to Olivier Berger for the patch. (Closes: #511300) handler changes all handlers: . Stop using "local VAR" outside functions. (Closes: #530647) dup: . Use --tempdir option rather than TMPDIR environment variable. (Closes Roundup bug #598) . Remove support for duplicity < 0.4.4. Even etch-backports has a newer one. . Now support remove-all-inc-but-n-full command for duplicity >= 0.9.10 to allow removal of increments for older full backups. Thanks to Olivier Berger for the patch. (Closes Redmine bug #2492) (Closes: #603478) ldap: . Fix reliance on bash for pipefail. mysql: . Fix reliance on bash for pipefail. Thanks to Sergio Talens-Oliag for the patch. (Closes: #602374) postgresql: . Support various pg_dump formats in addition to pg_dumpall. Thanks to Jacob Anawalt for the patch. (Closes Roundup bug #2534) . Fix reliance on bash for pipefail. rdiff: . Support reading include/exclude patterns from files using the "include @/etc/backup_includes" syntax (Closes Roundup bug #2370). Thanks to ale for the patch. rsync: . Fix long rotation. . Make units clearer (Closes Redmine bug #2737) . Do arithmetic using bash rather than bc (Closes: #603173) sys: . Fix hwinfo (Closes: #625501) . Fix gathering of information about loaded modules: cut is in /usr/bin actually. tar: . Install by default. (Closes Redmine bug #2907) helper changes dup: . Fix separate signing key usecase. Thanks to Ian Beckwith for the patch. . Make units clearer (Closes Redmine bug #2737) rdiff: . Generate 4096 bits RSA keys. tar: . Install by default. (Closes Redmine bug #2907) documentation changes . Recommend using 4096 bits RSA keys everywhere. version 0.9.8.1 -- October 31, 2010 (boo!) backupninja changes . Do not error out when no job is configured. Thanks to Jordi Mallach for the patch (Closes: #597684) handler changes sys: . Route around broken vgcfgbackup not able to handle multiple VG arguments version 0.9.8 -- September 12, 2010 backupninja changes . Added GZIP_OPTS option, defaulting to --rsyncable, so that this option can be disabled on systems that don't support it. This also allows to use another compression program, such as pbzip2 on SMP machines (Closes Roundup bug #2405) handler changes sys: . Only run mdadm if RAID devices actually exist (Closes: #572450) dup: . Now default to use --full-if-older-than; see the new "increments" option to opt-out or tweak the default (30D) delay between full backups. Thanks a lot to Olivier Berger (Closes: #535996) . Use duplicity's --extra-clean option to get rid of unnecessary old cache files when cleaning up. This is enabled when using duplicity 0.6.01 or newer, that depends on local caching (Closes: #572721) . Ignore anything but digits and "." when comparing versions (Closes: #578987) . Put archive directory (cache) into /var/cache/backupninja/duplicity rather than the default /root/.cache/duplicity, unless the user has specified it (Closes: 580213) . Better example.dup documentation. Thanks, Alster! . Added ftp_password option to securely transmit the FTP password from backupninja to duplicity. mysql: . Don't lock tables in the information_schema database (Closes: #587011) . Fix code logic to make dbusername/dbpassword actually usable (Closes Redmine bug #2264) rsync: . Fix lockfile checks. This prevents multiple instances of the same rsync job to run in parallel. . Avoid passing the remote user twice to rsync-over-ssh. doc changes manpage: . Fix typo in manpage (Closes: #583778) ldap: . Add ssl option description, fix tls option description (Closes Roundup bug #2407) version 0.9.7 -- January 27, 2010 backupninja changes . fix bug in reportspace, thanks Dan Garthwaite . do not assume English locale when using date (Closes: #465837) . add 'when = manual' option, that can be used in the global config file or in a given backup action file. Thanks Tuomas Jormola for the preliminary patch (Closes: #511299) . new reportinfo option: when set, messages sent by handlers with "info" are included in the report e-mail (closes #563734) . reportspace: skip non-directories and places that don't exist on the local filesystem (Closes: #536049) . set BACKUPNINJA_DEBUG when invoked with -d (Closes: #537266) lib changes easydialog: . Allow form fields input to grow up to 100 chars (Closes: #562249) handler changes ldap: . Use gzip's --rsyncable option. . Use bash pipefail option when needed so that failed dumps are reported as such. maildir: . fix location of deleted_on file . add missing destid_file options to ssh connections . added sshoptions variable for arbitrary ssh options . updated example file to include destid_file, destport and sshoptions . use any subdirectories not just "a" to "z". Thanks Chris Nolan! (Redmine#606) mysql: . Options passed to mysqldump are now customizable with the new sqldumpoptions configuration variable. Thanks to Chris Lamb for his preliminary patch (Closes: #502966) . Hide 'mysqladmin ping' output, to prevent confusing the user in case mysqld is running but the authentication fails, which apparently does not prevent mysqldump to work. . Fix the error message displayed when mysqld is not running: mysqladmin ping indeed returns 0 when authentication fails. . Use gzip's --rsyncable option. . Quote output filenames to support shell meta-characters in database names. . Use bash pipefail option when needed so that failed dumps are reported as such. pgsql: . Use gzip's --rsyncable option. . Quote output filenames to support shell meta-characters in database names. . Use bash pipefail option when needed so that failed dumps are reported as such. rdiff: . Fix include/exclude paths with spaces (Closes: #398435) . Fix confusing error if rdiff-backup cannot be found on remote server. . Increased element number in include/exclude and vserver ninjahelper interface sys: . New luksheaders option (default=disabled) to backup the Luks header of every Luks device. . New lvm option (default=disabled) to backup LVM metadata for every detected volume group. . Backup dmsetup info as well, for easier restoring of Luks headers. dup: . Fixed bandwidthlimit syntax error. Thanks to Ian Beckwith for the patch. . Send duplicity output to debug line by line instead of as a whole at one time (Closes: #536360) . Report duplicity output as "info" so that it can be included in report e-mail when reportinfo is on (Closes: #563734) . Fix include/exclude paths with spaces . Support backups to Amazon S3 buckets, thanks to stefan for the patch. helper changes dup: . Do not propose to exclude /home/*/.gnupg twice anymore (Closes: #563044) autotools . Added the stat command to the automagically replaced ones, hoping it will help supporting *BSD some day. version 0.9.6 -- July 21, 2008 backupninja changes . fix bug in cstream definition, thanks Jamie McClelland . Allow the entire backup run to be halted by an action, thanks to Matthew Palmer (Closes: #455836) . Fixed tr construct reporting a warning (Closes: #452669) lib changes vserver: . added vservers_running function tools . mktemp is now required to run backupninja, removed less secure fall-back if mktemp did not exist on the system handler changes dup: . General cleanup . Better support for new duplicity (>= 0.4.4) command line syntax: run remove-older-than when $keep is not set to yes (Closes: #458816), and run "duplicity cleanup" before any other duplicity command; both only trigger a warning on failure, since they should not stop backups from being done. Also migrated full/incremental backup switch to the new syntax. . Support every duplicity-supported transport with new configuration option desturl (Closes: #483712, #346040, Trac#2). . Actually allow to backup only VServers, by relaxing $include test. . Set secure permissions on tmpdir when creating it. ldap: . support HDB backend just as the BDB one, and make message clearer when no supported backend is found (Closes: #476910) rdiff: . Fixed ignore_version default value missing . Add patch from Matthew Palmer to rdiff handler to incorporate sshoptions into options via remote-schema not already specified (Closes: #424639) wget: . New handler from rhatto designed to incrementally pull content from a website to a local folder, based on the rsync handler maildir: . fixed bug where maildirs that start with a number were skipped . make maildir helper look in every subdirectory of the source directory for maildirs, rather than just looking in the directories [a-zA-Z0-9], thanks for the patch from chris@cenolan.com (Trac#43). . make deleted maildirs record the date they were deleted . add destid_file configuration option to enable you to specify an alternate ssh public key authentication file (defaulting to /root/.ssh/id_rsa) pgsql, mysql, svn, sys: . use new vservers_running function from lib/vserver (factorization++) sys: . update for 2.6 kernels: use /proc/kallsyms instead of /proc/ksyms (Closes: Trac#39) . support selection of VServers to run on, in the same way as in the dup handler, with the new vsnames configuration option ; (Closes: Trac#45) . add support for capturing the package debconf selection states using debconf-get-selections . fixed catifexec function to actually work, also now passes the arguments given to catifexec() to the called command (Thanks John Hallam!) . Added more robust software RAID information capture by running mdadm -Q --detail /dev/md?* because some people may have empty mdadm.conf files (Thanks to John Hallam). trac: . stop failing on all the trac backups if just one fails, this means removing the temporary trac backup directories if they fail makecd . updated handler for new toolset (genisoimage and wodim) version 0.9.5 -- December 2, 2007 backupninja changes . Fixed checks on configuration files permissions, since the patch applied to fix #370396 broke this, especially for configuration files created with permissions 000 by an older ninjahelper version. . Enhanced portability for other platforms . Added quoting because it was needed to prevent shell expansion, broking the toint function sometimes (Closes: Trac#11) . Fixed reportspace option (Closes: Trac#10) . Fixed ldap handler not recognizing database suffix (Closes: Trac#28) handler changes dup: . Support duplicity >= 0.4.3 invocation syntax (--ssh-command option is not supported anymore) (Closes: #447425) . New tmpdir configuration option, very useful in case duplicity tends to fill up /tmp. ldap: . Fixed shell command quoting issues, missing 'then' clauses, cleaned up compress=yes to be less redundant and not create empty uncompressed file (Closes: #394935) . Fixed ninjahelper to properly set compress option, standardized on yes/no instead of on/off . Fixed problem that caused combination of slapcat and compress to not work together (Closes: Trac#29) . Applied patch from romain.tartiere@healthgrid.org to fix the SSL/TLS options to be correct, also set TLS to be the default over SSL (Closes: Trac#13) maildir: . Added an examples file (Closes: Trac#23) . Applied patch from Anarcat that fixes the cp/mkdir calls to not use GNU coreutils options, as well as some bashisms (Closes: Trac#24) . Fix test mode (Closes: Trac#25) mysql: . Fixed case where odd combination of configuration options caused sqldump backups to get overwritten with an empty file (Closes: #402679) . Added 'nodata' option to enable you to specify tables that you want to omit the data from a backup, but still backup the table structure. This is very useful in cases where tables contain large amounts of cache data. See the example.mysql for options, thanks Daniel Bonniot (Closes: #408829) . Enhance code for selecting databases by asking MySQL not to give us the header (-N), to not draw pretty boxes around the output (-B), send the query via -e instead of a pipe and ensure MySQL listens to -B. Thanks to Matthew Palmer (Closes: #452039). pgsql: . Support configuring PGSQLUSER for real, and document it a bit; this broken support actually prevented pgsql handler to work for VServers (Closes: #396578) rdiff-backup: . Added cstream support to allow for bandwidth limiting . Handle "keep = yes" to disable old backups removal (Closes: #424633) . Add configuration option to allow you to disable the version check as in some instances this may be an ok scenario (Closes: #424632) . Added local destination support to helper (Closes: Trac#4) . Allow exclude-only configurations (Closes: Trac#21) rub/rsync . Fixed typo in rub handler that caused it to not work . Changed to use lib/vserver code . Fixed fsck error . Fixed integer comparison (Closes: Trac#3) . Renamed handler to 'rsync', replaces outdated rub handler . updated examples/Makefile.am and handlers/Makefile.am to include rsnap/rsync (Closes: #440554) . Added example.rsync configuration file sys: . Fixed typo breaking things for VServers. . Fix bug when vrootdir is on its own partition (Closes: #395928) . Better sfdisk error and output handling: should now properly warn when it does not manage to backup a partition table, and shut up when it succeeds (Closes: #396632) . Added option to not use sfdisk at all, useful for vserver/xen instances that produce warnings about no harddisks found (Closes: #404071) . Fixed example in example.sys to detail the __star__ in partitionsfile and note why its necessary (Closes: #409192) . Force C locale for sfdisk to ensure english words are found in grep . Make directory where output is placed configurable, and create the parent dir if it doesn't exist (Closes: Trac#1) ninjareport . Added first draft of method to aggregate reports from many servers into one email. Requires logtail, rsync, configuration of reporthost, reportdirectory and reportuser in backupninja.conf. Configure cron to run once a day, and individual backupninjas not to report by email their status, then enjoy one email report from all hosts, rather than multiple fixed 'make install' bug that failed if /etc/backup.d already existed changed spaces to tabs in Makefile.am updated redhat spec file (thanks Adam Monsen) version 0.9.4 -- October 6th, 2006 backupninja changes . Fixed bug in toint(), and thus isnow(), which caused it to not work when run from cron. . Recursively ignore subdirs in /etc/backup.d (Closes: #361102) . Add admingroup option to configuration to allow a group that can read/write configurations (instead of only allowing root). Checks and complains about group-readable files only when the group differs from the one in the configuration file (default is root as before). Thanks to Martin Krafft for the patch (Closes: #370396). . When determining which backup actions to make, find now follows symlinks for $configdirectory . Changed order of -s to mail for compatibility . fixed permission stat call so it uses the --format supported by coreutils (Closes: #382747) . Added disk space report option (thanks Adam Kosmin) handler changes Added tar handler: . create tarballs Added rsnap handler: . rotated rsync snapshops . code from paulv@bikkel.org Added rub handler: . alternative to rsnap . code from rhatto@riseup.net mysql: . Fixed improper use of $vuserhome (Closes: #351083) . Fixed erroneous removal of tmpfile when it didn't exit . Fixed inversed vsname emptiness check . Fixed su quote usage to be more posixy . Compress for sqldumps now happens in-line to save some disk space (Closes: #370778) . Fixed --defaults-file now as --defaults-extra-file (thanks rhatto) pgsql: . Fixed inversed vsname emptiness check . Fixed su quote usage to be more posixy . Fixed shell expansion, thanks Thomas Kotzian (Closes: #363297) . postgres user UID is now the one from inside the vserver if necessary . Compress now happens in-line to save some disk space (Closes: #370778) . $PGSQLUSER is used instead of hardcoding user 'postgres' (although this is the default) svn: . Fixed inversed vsname emptiness check rdiff: . Symlink and globbing support in include/exclude/vsinclude clarification: globbing is fully supported again, whereas no attempt is done to dereference symlinks anymore, due to incompatibilities between various readlink versions in this field. . Removed overzealous vsnames check . Now works if testconnect=no and if $test is not defined. . add $sshoptions config parameter in [dest] section of config so connections to ports other than 22 can be made by adding the following to the top of the handler config: options = --remote-schema 'ssh -p REMOTE-PORT -C %s rdiff-backup --server' dup: . Symlink and globbing support in include/exclude/vsinclude clarification: globbing is fully supported again, whereas no attempt is done to dereference symlinks anymore, due to incompatibilities between various readlink versions in this field. . Removed over zealous vsnames check . Does not pretend anymore that duplicity can work without any passphrase . Support duplicity 0.4.2 (with Debian patches applied; upstream's 0.4.3 will integrate them); documented how to write sftp-compatible sshoptions (Closes: #388543) . Now forbid to (try to) include /. sys: . Many more system checks were added, (thanks to Petr Klíma) . Added warning if no devices were found (thanks Ranier Zocholl) . Enhanced debian package selections to include purged packages (thanks Tom Hoover) . Removed warning about vserver not running (thanks anarcat) ldap: . Compress now happens in-line to save some disk space (Closes: #370778) makecd: . Added nicelevel option (thanks rhatto) trac: . fixed problem when src was set to the trac repo directly (Closes: #382737) lib changes vserver: . init_vservers: fixed Debian bug #351083 (improper readlink syntax) . found_vservers: escaped special grep repetition character + . forced mktemp to use a template with a name to be more compatible with different versions of mktemp, thanks anarcat ninjahelper changes . Recursively ignore subdirs in /etc/backup.d (Closes: #361102) . Fix configdirectory error that forced you to use /etc/backup.d, thanks anarcat . When determining which backup actions to list, find now follows symlinks for $configdirectory . Stop checking helpers perms: both "make install" and distros packages install them with appropriate permissions, it's overzealous to check this at runtime, and is more complicated to do with current admingroup option. dup.helper: . Fix: signing was enabled with symmetric encryption. changed cron permissions to 644 changed /etc/backup.d permissions to 0770 (for admingroup) minor documentation fixes improved RPM build process allowing 'make rpm-package' and 'make srpm-package' targets, also fixes permissions on man directories, cleans up RPM-related files during distclean, and adds default EDITOR for "autogen.sh -f" if none is set. (thanks Robert Napier) version 0.9.3 -- February 1st, 2006 autotools fixes backupninja changes backupninja.conf . added (commented out) the various default paths to programs such as PGSQLDUMP, so that users can figure out more easily they can customize them code refactor: . now uses vservers lib to initialize vservers support handler changes duplicity, mysql, pgsql, rdiff, svn, sys: start to use (at different degrees) new lib/vserver functionality mysql: . fixed no user defaults file processing duplicity: . fixed (again...) globbing in include and exclude options (Debian bug #348022, follow-up to #338796) . warn if vsnames or vsinclude is enabled while vservers support is disabled in backupninja.conf . now works when multiple vservers names are given (separated by space) in vsnames config variable rdiff . fixed globbing bug in include, exclude and vsinclude options . it's now possible to choose exactly which vservers should be backed-up, as it already was with duplicity handler, with the "vsnames" configuration setting ninjahelper changes rdiff.helper: . fixed errors in create remote dir . code formatting cleanup (three spaces indent) . fixed bug which caused only first include/exclude dir to have "include = " . fixed globbing bug with exclude ninjahelper: . now reports error if the helper script has a syntax error or bombs out. . code formatting cleanup (three spaces indent) lib changes vserver: . init_vservers: improved VROOTDIR detection . init_vservers: test in a stricter way the real vservers availability . init_vservers: canonicalize VROOTDIR (since duplicity et al. don't follow symlinks) . init_vservers: warn if vservers are enabled but no vserver is found . new function: vservers_exist known bugs: easydialog: . formDisplay does not return exit status. version 0.9.2 -- December 29, 2005 backupninja changes fixed broken toint() which caused when "everyday" problems backupninja.conf.5 updated to include "when" and "vservers" code refactor: . moved to lib/ some code that has to be shared between backupninja and ninjahelper handler changes trac: . mkdir subdirectory problem fixed duplicity: . globbing support fixed in include and exclude options . different signing and encrypting key support added . fixed erroneous comments in example.dup about the way GnuPG-related options are used mysql: . handler vserver bugs fixed and debug output enhanced ninjahelper(s) changes vserver-related functions added to lib/vservers.in added man/ninjahelper.1 man page makecd: . was missing in Makefile.am/.in rdiff-backup: . used to expand '*' in default source directories . the "Cancel" buttons used to have a weird behaviour . updated to include Vserver selection pgsql: . forbid the user to choose an empty database set . "Cancel" button now does what it is meant to do mysql: . enhanced for vserver support . now able to select databases and dump directory duplicity: . new handler added (with Vserver support) version 0.9.1 -- November 05 2005 rearranged source so that it is relocatable with autotools (thanks to Petr Klíma petr.klima@madeta-group.cz) fixed many bugs in rdiff helper rdiff handler does not require 'label' (for real this time?) added makecd ninjahelper (thanks to Stefani stefani@riseup.net) made ninjahelper create files with mode 600 rather than 000 changed subversion handler to use svnadmin hotcopy instead of the unsupported hot-copy.py script, which was moved in Debian update rdiff ninjahelper now detects and auto-install rdiff-backup on the remote machine if possible, also tests the remote backup directory and offers to create it if it doesn't exist version 0.9 -- October 19 2005 *** IMPORTANT CHANGE, UPGRADE AT ONCE *** fixed insecure temporary file creation ***************************************** removed erroneous magic file marker in pgsql handler fixed incorrect find positional changed direct grep of /etc/passwd to getent passwd. rdiff helper has much better information on failed ssh attempt (patch from cmccallum@thecsl.org). rdiff handler now supports remote source and local dest. (patch from cmccallum@thecsl.org). man pages are greatly improved. version 0.8 -- September 15 2005 added pgsql (PostgreSQL) handler, with vservers support. added vservers support to duplicity handler Note: the configuration is a bit different than the rdiff handler's one, but the default behavior is the same: have a look at example.dup. improved README documented .disabled method. corrected VROOTDIR default value. added ninjahelper to the install instructions. improved rdiff, dup and sys handlers' vservers support prevent vserver-debiantools' $VROOTDIR/ARCHIVES directory to be seen as a vserver changes to sys handler make use of configurable $VSERVERINFO instead of hard-coded vserver-info. fixed dpkg existence test inside vserver. fixed $nodpkg use. changes to pgsql handler now checks if the specified vserver is running. now checks if $PGSQLDUMP/$PGSQLDUMPALL are available where needed. now checks if "postgres" user exists on the host/vserver. changes to ninjahelper check_perms() does not die anymore on group/world readable helper scripts (now consistent with the "helper scripts must not be group or world writable!" error msg). xedit action now tries $EDITOR, then /etc/alternatives/editor, then nano, vim and vi, and aborts if none of these exists. added helper for pgsql handler. rdiff handler now does not require 'label' changes to mysql and svn handlers' vservers support these handlers now check if the source vserver is running added 'ignores' for mysql handler. (thanks Daniel.Bonniot@inria.fr) version 0.7 -- July 26 2005 added ninjahelper: a dialog based wizard for creating backupninja configs. considerably improved and changed the log file output. you can now disable actions with .disabled (this is new preferred method). added makecd handler and example.makecd for backing up to cd/dvd (thanks stef). fixed bug when specifying multiple 'when' options. version 0.6 -- June 16 2005 ldap handler has new options: backup method to use (ldapsearch or slapcat), restart, passwordfile and binddn. Default backup method is set to ldapsearch as this is safer ****************************************************************** NOTE: to get the previous default behavior with the ldap handler, you must set "method = slapcat". The new default is ldapsearch. ****************************************************************** implemented fix so that the main script will echo fatal errors rather than being silent about them, this means an error message every hour if there is a major configuration problem (not a handler problem) added vserver support to main script and to the handlers: mysql, svn, sys, rdiff changes to duplicity handler (thanks intrigeri!): "keep = yes" now disables file cleaning on desthost added "sign" option for backups signing added "encryptkey" option to specify the gpg key to use split config into [source], [gpg] and [dest] sections added "nicelevel" option added "testconnect" option added "sshoptions" option (will be passed to ssh/scp) added "bandwidthlimit" option example.dup example config file for duplicity handler added trac (http://trac.edgewall.com/) environment handler (thanks Charles Lepple!) added configfile option to mysql handler the default is /etc/mysql/debian.cnf. with this, sqldump doesn't need dbusername. (hotcopy still does). fixed bug in mysql handler which caused some passwords to not work. (.my.cnf files now have double quotes around password) can now pass options to hwinfo and sfdisk in sys handler. version 0.5 -- April 12 2005 rdiff handler works when remote sshd has a banner rdiff handler supports local dest logfile is created if it doesn't exist added "when = hourly" added optional 'nicelevel' to rdiff handler fixed bug where actions were not run in numeric order. improved 'when' parsing. version 0.4.4 -- March 18 2005 results of handlers are now read line by line. changes to rdiff handler: added "options", and "keep" is not necessarily days now (ie, it will pass straight through to rdiff-backup if the keep has a unit on it, otherwise it adds the 'D'). added dup handler (still pretty beta) added maildir handler (very specialized handler) added --run option (runs the specified action file) improved sys handler, now uses hwinfo added subversion hotbackup handler, svn. added PATH to cron.d file, which fixes file not found errors. version 0.4.2 -- Jan 6 2005 fixed bug which caused a report email to be sent even if no actions were run. fixed bug where multiple handler status messages were ignored added status in the subject line of report emails version 0.4.1 -- Jan 3 2005 added $usecolors and now more conservative about when colors are echoed. fixed major bug, 'when' actually works now. replaced debug function with debug, info, warning, error, fatal. added --now option to force all actions to be performed now. version 0.4 -- Dec 26 2004 added "when" option, so that all configs can specify when they are to be run. added reportsuccess and reportwarning config options added .sys handler (hardware, packages, partitions). version 0.3.4 -- Dec 8 2004 fixed numerical variable quoting compatibility with older wc fixed stderr redirect bug some comments in example.rdiff version 0.3.3 -- Nov 10 2004 '*' (asterisk) works now in rdiff config files works now with gawk as well as mawk many bug fixes to ldap handler paths to helper scripts can be configured in global config does not require /usr/bin/stat version 0.3.2 -- Sept 29 2004 handler scripts are no longer executable (to comply with debian policy) handler error and warning messages are sent with the notify email version 0.3.1 -- Sept 5 2004 added ldap handler moved sh support to a handler script add test mode, where no action is taken. added --help force only root can read /etc/backup.d/* fixed missing equals symbols in example.rdiff changed backupninja executable to be /usr/sbin rather than /usr/bin version 0.3 -- Oct 20 2004 ** IMPORTANT ** all config files are now ini style, not apache style rewrote all scripts in bash for portability added drop-in backupninja lib directory (/usr/share/backupninja) all scripts are now run as root version 0.2 -- Oct 14 2004 move distribution folder ./cron.d to ./etc/cron.d fixed bug: removed printr of excludes (!) added support for changing the user/group in rdiff sources. added support for .mysql config files. version 0.1 -- Oct 8 2004 initial release backupninja-1.1.0/FAQ.md0000644000175000017500000000533213230423112011642 00000000000000duplicity works fine when run standalone, but complains about gpg "public key not found" when run from backupninja ================================================================================================================== We bet you're using sudo to run both duplicity and backupninja, and have been using sudo as well when generating the GnuPG key pair used by duplicity. Quick fix: generate a new GnuPG key pair in a root shell, or using `sudo -H` instead of plain sudo. Another solution: import the GnuPG keypair into the root user's keyring, taking care of running `gpg --update-trustdb` in a root shell or using `sudo -H` afterwards, in order to tag this keypair as "ultimately trusted". Detailed explanation: sudo does not change `$HOME` by default, so GnuPG saved the newly generated key pair to your own keyring, rather than to the root user's keyring. Running `sudo duplicity` hides the problem, as it uses your own keyring. Running `sudo backupninja` reveals the problem, as backupninja uses `su` to make sure it runs duplicity in a real root environment, i.e. using the root user's GnuPG keyring. What should I do when rdiff-backup fails? ========================================= If rdiff-backup fails, the meta data file may get corrupt. When this happens, rdiff-backup will complain loudly every time it is run and possibly fail to backup some or all the files. To force rdiff-backup to rebuild the meta data, set this option in the `.rdiff` backup action file: options = --force After a rdiff-backup run has been successful you should remove this option. How to restrict privileges on the backup server? ================================================ backupninja uses a "push" mechanism, where backups are sent from one or several hosts to a centralized backup server. Mount your backup partition with limited execution rights --------------------------------------------------------- Edit `/etc/fstab` to mount your partition with limited rights. For example: /home ext3 defaults,nosuid,noexec,nodev 0 2 Create a user for each client ----------------------------- On the backup server, it is important to create a separate user for each client. Use a restricted shell and jail users ------------------------------------- Furthermore, you may use a restricted shell like [rssh](http://www.pizzashack.org/rssh/index.shtml) or [scponly](http://sublimation.org/scponly/wiki/index.php/Main_Page), which also offer the ability to jail connections. On the backup server: $ apt-get install scponly $ adduser --disabled-password --home /home/backup/ninja-host1 --shell /usr/bin/scponly ninja-host1 You may now use `ninja-host1` user to connect to the `/home/backup/ninja-host1` jail. backupninja-1.1.0/Makefile.am0000644000175000017500000000324113230423112012742 00000000000000# vi: noexpandtab softtabstop=0 ## Process this file with automake to produce Makefile.in EXTRA_DIST = FAQ.md README.md COPYING AUTHORS INSTALL.md NEWS ChangeLog \ backupninja.spec backupninja.spec.in autogen.sh SUBDIRS = etc examples handlers lib man src local_rpm_topdir=`cd $(top_srcdir) && pwd`/rpm rpm-package: dist if test x$(HAVE_RPM) = xyes ; then \ mkdir -p $(local_rpm_topdir) ; \ cd $(local_rpm_topdir) ; \ mkdir -p BUILD RPMS SOURCES SPECS ; \ cd SOURCES ; \ $(LN_S) ../../$(distdir).tar.gz ; \ cd .. ; \ cd SPECS ; \ $(LN_S) ../../backupninja.spec . ; \ cd .. ; \ rpmbuild --define "_topdir `cd . && pwd`" -bb SPECS/backupninja.spec && \ echo "Package successfully built in `pwd`/RPMS." ; \ else \ echo "Error: RPM executable and/or source directory not found." ; \ fi srpm-package: dist if test x$(HAVE_RPM) = xyes ; then \ mkdir -p $(local_rpm_topdir) ; \ cd $(local_rpm_topdir) ; \ mkdir -p BUILD SRPMS SOURCES SPECS ; \ cd SOURCES ; \ $(LN_S) ../../$(distdir).tar.gz ; \ cd .. ; \ cd SPECS ; \ $(LN_S) ../../backupninja.spec . \ cd .. ; \ rpmbuild --define "_topdir `cd . && pwd`" -bs SPECS/backupninja.spec && \ echo "Package successfully built in `pwd`/SRPMS." ; \ else \ echo "Error: RPM executable and/or source directory not found." ; \ fi clean-local: -rm -rf $(local_rpm_topdir) backupninja-1.1.0/COPYING0000644000175000017500000004307613230423112011753 00000000000000 GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) 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 the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. backupninja-1.1.0/INSTALL.md0000644000175000017500000000105113315451520012343 00000000000000Installation ============ On Debian, Ubuntu and derivatives --------------------------------- Run `apt-get install backupninja`. By hand ------- Requirements: bash gawk Recommended: rdiff-backup duplicity rsync borgbackup gzip hwinfo sfdisk cryptsetup flashrom hwinfo To install backupninja, simply do the following: $ ./autogen.sh $ ./configure $ make $ make install You may wish to change the install locations, or other options. To find the available possibilities, run `./configure --help`. backupninja-1.1.0/Makefile.in0000644000175000017500000006150013315454012012764 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # 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, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # vi: noexpandtab softtabstop=0 VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 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 \ $(am__configure_deps) $(am__DIST_COMMON) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = backupninja.spec CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ cscope distdir dist dist-all distcheck am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags CSCOPE = cscope DIST_SUBDIRS = $(SUBDIRS) am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/backupninja.spec.in \ AUTHORS COPYING ChangeLog NEWS TODO install-sh missing DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ if test -d "$(distdir)"; then \ find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ && rm -rf "$(distdir)" \ || { sleep 5 && rm -rf "$(distdir)"; }; \ else :; fi am__post_remove_distdir = $(am__remove_distdir) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best DIST_TARGETS = dist-gzip distuninstallcheck_listfiles = find . -type f -print am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BASH = @BASH@ CFGDIR = @CFGDIR@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ HAVE_RPM = @HAVE_RPM@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MKTEMP = @MKTEMP@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STAT = @STAT@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_cv_have_rpm = @ac_cv_have_rpm@ am__leading_dot = @am__leading_dot@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build_alias = @build_alias@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host_alias = @host_alias@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ EXTRA_DIST = FAQ.md README.md COPYING AUTHORS INSTALL.md NEWS ChangeLog \ backupninja.spec backupninja.spec.in autogen.sh SUBDIRS = etc examples handlers lib man src local_rpm_topdir = `cd $(top_srcdir) && pwd`/rpm all: all-recursive .SUFFIXES: am--refresh: Makefile @: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \ $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ echo ' $(SHELL) ./config.status'; \ $(SHELL) ./config.status;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(top_srcdir)/configure: $(am__configure_deps) $(am__cd) $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): $(am__aclocal_m4_deps) $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) $(am__aclocal_m4_deps): backupninja.spec: $(top_builddir)/config.status $(srcdir)/backupninja.spec.in cd $(top_builddir) && $(SHELL) ./config.status $@ # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscope: cscope.files test ! -s cscope.files \ || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS) clean-cscope: -rm -f cscope.files cscope.files: clean-cscope cscopelist cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -rm -f cscope.out cscope.in.out cscope.po.out cscope.files distdir: $(DISTFILES) $(am__remove_distdir) test -d "$(distdir)" || mkdir "$(distdir)" @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done -test -n "$(am__skip_mode_fix)" \ || find "$(distdir)" -type d ! -perm -755 \ -exec chmod u+rwx,go+rx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r "$(distdir)" dist-gzip: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__post_remove_distdir) dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 $(am__post_remove_distdir) dist-lzip: distdir tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz $(am__post_remove_distdir) dist-xz: distdir tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz $(am__post_remove_distdir) dist-tarZ: distdir @echo WARNING: "Support for distribution archives compressed with" \ "legacy program 'compress' is deprecated." >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__post_remove_distdir) 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) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz $(am__post_remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) $(am__post_remove_distdir) dist dist-all: $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:' $(am__post_remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.lz*) \ lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ *.tar.xz*) \ xz -dc $(distdir).tar.xz | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ esac chmod -R a-w $(distdir) chmod u+w $(distdir) mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst chmod a-w $(distdir) test -d $(distdir)/_build || exit 0; \ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && am__cwd=`pwd` \ && $(am__cd) $(distdir)/_build/sub \ && ../../configure \ $(AM_DISTCHECK_CONFIGURE_FLAGS) \ $(DISTCHECK_CONFIGURE_FLAGS) \ --srcdir=../.. --prefix="$$dc_install_base" \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) uninstall \ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ distuninstallcheck \ && chmod -R a-w "$$dc_install_base" \ && ({ \ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ } || { rm -rf "$$dc_destdir"; exit 1; }) \ && rm -rf "$$dc_destdir" \ && $(MAKE) $(AM_MAKEFLAGS) dist \ && rm -rf $(DIST_ARCHIVES) \ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ && cd "$$am__cwd" \ || exit 1 $(am__post_remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' distuninstallcheck: @test -n '$(distuninstallcheck_dir)' || { \ echo 'ERROR: trying to run $@ with an empty' \ '$$(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ $(am__cd) '$(distuninstallcheck_dir)' || { \ echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ echo " (check DESTDIR support)"; \ fi ; \ $(distuninstallcheck_listfiles) ; \ exit 1; } >&2 distcleancheck: distclean @if test '$(srcdir)' = . ; then \ echo "ERROR: distcleancheck can only run from a VPATH build" ; \ exit 1 ; \ fi @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left in build directory after distclean:" ; \ $(distcleancheck_listfiles) ; \ exit 1; } >&2 check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-local mostlyclean-am distclean: distclean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \ am--refresh check check-am clean clean-cscope clean-generic \ clean-local cscope cscopelist-am ctags ctags-am dist dist-all \ dist-bzip2 dist-gzip dist-lzip dist-shar dist-tarZ dist-xz \ dist-zip distcheck distclean distclean-generic distclean-tags \ distcleancheck distdir distuninstallcheck dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs installdirs-am maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ pdf-am ps ps-am tags tags-am uninstall uninstall-am .PRECIOUS: Makefile rpm-package: dist if test x$(HAVE_RPM) = xyes ; then \ mkdir -p $(local_rpm_topdir) ; \ cd $(local_rpm_topdir) ; \ mkdir -p BUILD RPMS SOURCES SPECS ; \ cd SOURCES ; \ $(LN_S) ../../$(distdir).tar.gz ; \ cd .. ; \ cd SPECS ; \ $(LN_S) ../../backupninja.spec . ; \ cd .. ; \ rpmbuild --define "_topdir `cd . && pwd`" -bb SPECS/backupninja.spec && \ echo "Package successfully built in `pwd`/RPMS." ; \ else \ echo "Error: RPM executable and/or source directory not found." ; \ fi srpm-package: dist if test x$(HAVE_RPM) = xyes ; then \ mkdir -p $(local_rpm_topdir) ; \ cd $(local_rpm_topdir) ; \ mkdir -p BUILD SRPMS SOURCES SPECS ; \ cd SOURCES ; \ $(LN_S) ../../$(distdir).tar.gz ; \ cd .. ; \ cd SPECS ; \ $(LN_S) ../../backupninja.spec . \ cd .. ; \ rpmbuild --define "_topdir `cd . && pwd`" -bs SPECS/backupninja.spec && \ echo "Package successfully built in `pwd`/SRPMS." ; \ else \ echo "Error: RPM executable and/or source directory not found." ; \ fi clean-local: -rm -rf $(local_rpm_topdir) # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: backupninja-1.1.0/etc/0000755000175000017500000000000013315454014011552 500000000000000backupninja-1.1.0/etc/backupninja.conf.in0000644000175000017500000000473113230423112015227 00000000000000# # |\_ # B A C K U P N I N J A /()/ # `\| # main configuration file # # how verbose to make the logs # 5 -- Debugging messages (and below) # 4 -- Informational messages (and below) # 3 -- Warnings (and below) # 2 -- Errors (and below) # 1 -- Fatal errors (only) loglevel = 4 # send a summary of the backup status to # this email address: reportemail = root # if set to 'yes', a report email will be generated # even if all modules reported success. (default = yes) reportsuccess = yes # if set to 'yes', info messages from handlers will be # sent into the email (default = no) reportinfo = no # if set to 'yes', a report email will be generated # even if there was no error. (default = yes) reportwarning = yes # if set to 'yes', disk space usage will be included in # the backup email report reportspace = no # where to rsync the backupninja.log to be aggregated in # a ninjareport reporthost = # what user to connect to reporthost to sync the # backupninja.log reportuser = ninja # where on the reporthost should the report go # NOTE: the name of the log will be used in the report, # use a globally unique name, preferably the hostname reportdirectory = /var/lib/backupninja/reports # set to the administration group that is allowed to # read/write configuration files in /etc/backup.d admingroup = root ####################################################### # for most installations, the defaults below are good # ####################################################### # where to log: logfile = @localstatedir@/log/backupninja.log # directory where all the backup configuration files live configdirectory = @CFGDIR@/backup.d # where backupninja helper scripts are found scriptdirectory = @pkgdatadir@ # where backupninja libs are found libdirectory = @pkglibdir@ # whether to use colors in the log file usecolors = yes # default value for 'when' when = everyday at 01:00 # if running vservers, set to yes vservers = no # programs paths # SLAPCAT=/usr/sbin/slapcat # LDAPSEARCH=/usr/bin/ldapsearch # RDIFFBACKUP=/usr/bin/rdiff-backup # CSTREAM=/usr/bin/cstream # MYSQL=/usr/bin/mysql # MYSQLHOTCOPY=/usr/bin/mysqlhotcopy # MYSQLDUMP=/usr/bin/mysqldump # PSQL=/usr/bin/psql # PGSQLDUMP=/usr/bin/pg_dump # PGSQLDUMPALL=/usr/bin/pg_dumpall # GZIP=/bin/gzip # GZIP_OPTS='--rsyncable' # RSYNC=/usr/bin/rsync # VSERVERINFO=/usr/sbin/vserver-info # VSERVER=/usr/sbin/vserver # VROOTDIR=/var/lib/vservers backupninja-1.1.0/etc/Makefile.am0000644000175000017500000000222513230423112013516 00000000000000 EXTRA_DIST = backupninja.conf.in cron.d/backupninja.in \ logrotate.d/backupninja.in GENERATED_FILES = backupninja.conf cron.d/backupninja logrotate.d/backupninja CLEANFILES = $(GENERATED_FILES) nobase_sysconf_DATA = $(GENERATED_FILES) edit = sed \ -e "s,@BASH\@,$(BASH),g" \ -e "s,@CFGDIR\@,$(CFGDIR),g" \ -e "s,@sysconfdir\@,$(sysconfdir),g" \ -e "s,@localstatedir\@,$(localstatedir),g" \ -e "s,@pkgdatadir\@,$(pkgdatadir),g" \ -e "s,@pkglibdir\@,$(pkglibdir),g" \ -e "s,@sbindir\@,$(sbindir),g" \ -e "s,@exec_prefix\@,$(exec_prefix),g" \ -e "s,@prefix\@,$(prefix),g" cron.d/backupninja: cron.d/backupninja.in rm -f cron.d/backupninja $(edit) cron.d/backupninja.in > cron.d/backupninja chmod 644 cron.d/backupninja logrotate.d/backupninja: logrotate.d/backupninja.in rm -f logrotate.d/backupninja $(edit) logrotate.d/backupninja.in > logrotate.d/backupninja chmod ugo+x logrotate.d/backupninja backupninja.conf: backupninja.conf.in rm -f backupninja.conf $(edit) backupninja.conf.in > backupninja.conf install-data-hook: mkdir -p $(DESTDIR)/$(sysconfdir)/backup.d chmod 0770 $(DESTDIR)/$(sysconfdir)/backup.d backupninja-1.1.0/etc/Makefile.in0000644000175000017500000003454413315454012013547 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # 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, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : subdir = etc ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 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) mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(sysconfdir)" DATA = $(nobase_sysconf_DATA) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BASH = @BASH@ CFGDIR = @CFGDIR@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ HAVE_RPM = @HAVE_RPM@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MKTEMP = @MKTEMP@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STAT = @STAT@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_cv_have_rpm = @ac_cv_have_rpm@ am__leading_dot = @am__leading_dot@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build_alias = @build_alias@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host_alias = @host_alias@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ EXTRA_DIST = backupninja.conf.in cron.d/backupninja.in \ logrotate.d/backupninja.in GENERATED_FILES = backupninja.conf cron.d/backupninja logrotate.d/backupninja CLEANFILES = $(GENERATED_FILES) nobase_sysconf_DATA = $(GENERATED_FILES) edit = sed \ -e "s,@BASH\@,$(BASH),g" \ -e "s,@CFGDIR\@,$(CFGDIR),g" \ -e "s,@sysconfdir\@,$(sysconfdir),g" \ -e "s,@localstatedir\@,$(localstatedir),g" \ -e "s,@pkgdatadir\@,$(pkgdatadir),g" \ -e "s,@pkglibdir\@,$(pkglibdir),g" \ -e "s,@sbindir\@,$(sbindir),g" \ -e "s,@exec_prefix\@,$(exec_prefix),g" \ -e "s,@prefix\@,$(prefix),g" all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign etc/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign etc/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-nobase_sysconfDATA: $(nobase_sysconf_DATA) @$(NORMAL_INSTALL) @list='$(nobase_sysconf_DATA)'; test -n "$(sysconfdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(sysconfdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(sysconfdir)" || exit 1; \ fi; \ $(am__nobase_list) | while read dir files; do \ xfiles=; for file in $$files; do \ if test -f "$$file"; then xfiles="$$xfiles $$file"; \ else xfiles="$$xfiles $(srcdir)/$$file"; fi; done; \ test -z "$$xfiles" || { \ test "x$$dir" = x. || { \ echo " $(MKDIR_P) '$(DESTDIR)$(sysconfdir)/$$dir'"; \ $(MKDIR_P) "$(DESTDIR)$(sysconfdir)/$$dir"; }; \ echo " $(INSTALL_DATA) $$xfiles '$(DESTDIR)$(sysconfdir)/$$dir'"; \ $(INSTALL_DATA) $$xfiles "$(DESTDIR)$(sysconfdir)/$$dir" || exit $$?; }; \ done uninstall-nobase_sysconfDATA: @$(NORMAL_UNINSTALL) @list='$(nobase_sysconf_DATA)'; test -n "$(sysconfdir)" || list=; \ $(am__nobase_strip_setup); files=`$(am__nobase_strip)`; \ dir='$(DESTDIR)$(sysconfdir)'; $(am__uninstall_files_from_dir) tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(DATA) installdirs: for dir in "$(DESTDIR)$(sysconfdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) install-data-hook install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-nobase_sysconfDATA install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-nobase_sysconfDATA .MAKE: install-am install-data-am install-strip .PHONY: all all-am check check-am clean clean-generic cscopelist-am \ ctags-am distclean distclean-generic distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-data-hook install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man \ install-nobase_sysconfDATA install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ pdf-am ps ps-am tags-am uninstall uninstall-am \ uninstall-nobase_sysconfDATA .PRECIOUS: Makefile cron.d/backupninja: cron.d/backupninja.in rm -f cron.d/backupninja $(edit) cron.d/backupninja.in > cron.d/backupninja chmod 644 cron.d/backupninja logrotate.d/backupninja: logrotate.d/backupninja.in rm -f logrotate.d/backupninja $(edit) logrotate.d/backupninja.in > logrotate.d/backupninja chmod ugo+x logrotate.d/backupninja backupninja.conf: backupninja.conf.in rm -f backupninja.conf $(edit) backupninja.conf.in > backupninja.conf install-data-hook: mkdir -p $(DESTDIR)/$(sysconfdir)/backup.d chmod 0770 $(DESTDIR)/$(sysconfdir)/backup.d # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: backupninja-1.1.0/etc/logrotate.d/0000755000175000017500000000000013315454014013774 500000000000000backupninja-1.1.0/etc/logrotate.d/backupninja.in0000644000175000017500000000012013230423112016511 00000000000000@localstatedir@/log/backupninja.log { rotate 6 monthly compress missingok } backupninja-1.1.0/etc/cron.d/0000755000175000017500000000000013315454014012735 500000000000000backupninja-1.1.0/etc/cron.d/backupninja.in0000644000175000017500000000040013230423112015453 00000000000000# /etc/cron.d/backupninja -- cron tab entry for package backupninja PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin # run backupninja every hour on the hour 0 * * * * root if [ -x @sbindir@/backupninja ]; then @sbindir@/backupninja; fi backupninja-1.1.0/install-sh0000755000175000017500000003546313315454012012734 00000000000000#!/bin/sh # install - install a program, script, or datafile scriptversion=2014-09-12.12; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the # following copyright and license. # # Copyright (C) 1994 X Consortium # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or # sell copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # Except as contained in this notice, the name of the X Consortium shall not # be used in advertising or otherwise to promote the sale, use or other deal- # ings in this Software without prior written authorization from the X Consor- # tium. # # # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent # 'make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. tab=' ' nl=' ' IFS=" $tab$nl" # Set DOITPROG to "echo" to test this script. doit=${DOITPROG-} doit_exec=${doit:-exec} # Put in absolute file names if you don't have them in your path; # or use environment vars. chgrpprog=${CHGRPPROG-chgrp} chmodprog=${CHMODPROG-chmod} chownprog=${CHOWNPROG-chown} cmpprog=${CMPPROG-cmp} cpprog=${CPPROG-cp} mkdirprog=${MKDIRPROG-mkdir} mvprog=${MVPROG-mv} rmprog=${RMPROG-rm} stripprog=${STRIPPROG-strip} posix_mkdir= # Desired mode of installed file. mode=0755 chgrpcmd= chmodcmd=$chmodprog chowncmd= mvcmd=$mvprog rmcmd="$rmprog -f" stripcmd= src= dst= dir_arg= dst_arg= copy_on_change=false is_target_a_directory=possibly usage="\ Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE or: $0 [OPTION]... SRCFILES... DIRECTORY or: $0 [OPTION]... -t DIRECTORY SRCFILES... or: $0 [OPTION]... -d DIRECTORIES... In the 1st form, copy SRCFILE to DSTFILE. In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. In the 4th, create DIRECTORIES. Options: --help display this help and exit. --version display version info and exit. -c (ignored) -C install only if different (preserve the last data modification time) -d create directories instead of installing files. -g GROUP $chgrpprog installed files to GROUP. -m MODE $chmodprog installed files to MODE. -o USER $chownprog installed files to USER. -s $stripprog installed files. -t DIRECTORY install into DIRECTORY. -T report an error if DSTFILE is a directory. Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG " while test $# -ne 0; do case $1 in -c) ;; -C) copy_on_change=true;; -d) dir_arg=true;; -g) chgrpcmd="$chgrpprog $2" shift;; --help) echo "$usage"; exit $?;; -m) mode=$2 case $mode in *' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*) echo "$0: invalid mode: $mode" >&2 exit 1;; esac shift;; -o) chowncmd="$chownprog $2" shift;; -s) stripcmd=$stripprog;; -t) is_target_a_directory=always dst_arg=$2 # Protect names problematic for 'test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac shift;; -T) is_target_a_directory=never;; --version) echo "$0 $scriptversion"; exit $?;; --) shift break;; -*) echo "$0: invalid option: $1" >&2 exit 1;; *) break;; esac shift done # We allow the use of options -d and -T together, by making -d # take the precedence; this is for compatibility with GNU install. if test -n "$dir_arg"; then if test -n "$dst_arg"; then echo "$0: target directory not allowed when installing a directory." >&2 exit 1 fi fi if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. # Otherwise, the last argument is the destination. Remove it from $@. for arg do if test -n "$dst_arg"; then # $@ is not empty: it contains at least $arg. set fnord "$@" "$dst_arg" shift # fnord fi shift # arg dst_arg=$arg # Protect names problematic for 'test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac done fi if test $# -eq 0; then if test -z "$dir_arg"; then echo "$0: no input file specified." >&2 exit 1 fi # It's OK to call 'install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi if test -z "$dir_arg"; then if test $# -gt 1 || test "$is_target_a_directory" = always; then if test ! -d "$dst_arg"; then echo "$0: $dst_arg: Is not a directory." >&2 exit 1 fi fi fi if test -z "$dir_arg"; then do_exit='(exit $ret); exit $ret' trap "ret=129; $do_exit" 1 trap "ret=130; $do_exit" 2 trap "ret=141; $do_exit" 13 trap "ret=143; $do_exit" 15 # Set umask so as not to create temps with too-generous modes. # However, 'strip' requires both read and write access to temps. case $mode in # Optimize common cases. *644) cp_umask=133;; *755) cp_umask=22;; *[0-7]) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw='% 200' fi cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; *) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw=,u+rw fi cp_umask=$mode$u_plus_rw;; esac fi for src do # Protect names problematic for 'test' and other utilities. case $src in -* | [=\(\)!]) src=./$src;; esac if test -n "$dir_arg"; then dst=$src dstdir=$dst test -d "$dstdir" dstdir_status=$? else # Waiting for this to be detected by the "$cpprog $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if test ! -f "$src" && test ! -d "$src"; then echo "$0: $src does not exist." >&2 exit 1 fi if test -z "$dst_arg"; then echo "$0: no destination specified." >&2 exit 1 fi dst=$dst_arg # If destination is a directory, append the input filename; won't work # if double slashes aren't ignored. if test -d "$dst"; then if test "$is_target_a_directory" = never; then echo "$0: $dst_arg: Is a directory" >&2 exit 1 fi dstdir=$dst dst=$dstdir/`basename "$src"` dstdir_status=0 else dstdir=`dirname "$dst"` test -d "$dstdir" dstdir_status=$? fi fi obsolete_mkdir_used=false if test $dstdir_status != 0; then case $posix_mkdir in '') # Create intermediate dirs using mode 755 as modified by the umask. # This is like FreeBSD 'install' as of 1997-10-28. umask=`umask` case $stripcmd.$umask in # Optimize common cases. *[2367][2367]) mkdir_umask=$umask;; .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; *[0-7]) mkdir_umask=`expr $umask + 22 \ - $umask % 100 % 40 + $umask % 20 \ - $umask % 10 % 4 + $umask % 2 `;; *) mkdir_umask=$umask,go-w;; esac # With -d, create the new directory with the user-specified mode. # Otherwise, rely on $mkdir_umask. if test -n "$dir_arg"; then mkdir_mode=-m$mode else mkdir_mode= fi posix_mkdir=false case $umask in *[123567][0-7][0-7]) # POSIX mkdir -p sets u+wx bits regardless of umask, which # is incompatible with FreeBSD 'install' when (umask & 300) != 0. ;; *) # $RANDOM is not portable (e.g. dash); use it when possible to # lower collision chance tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ trap 'ret=$?; rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null; exit $ret' 0 # As "mkdir -p" follows symlinks and we work in /tmp possibly; so # create the $tmpdir first (and fail if unsuccessful) to make sure # that nobody tries to guess the $tmpdir name. if (umask $mkdir_umask && $mkdirprog $mkdir_mode "$tmpdir" && exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1 then if test -z "$dir_arg" || { # Check for POSIX incompatibilities with -m. # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or # other-writable bit of parent directory when it shouldn't. # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. test_tmpdir="$tmpdir/a" ls_ld_tmpdir=`ls -ld "$test_tmpdir"` case $ls_ld_tmpdir in d????-?r-*) different_mode=700;; d????-?--*) different_mode=755;; *) false;; esac && $mkdirprog -m$different_mode -p -- "$test_tmpdir" && { ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"` test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" } } then posix_mkdir=: fi rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" else # Remove any dirs left behind by ancient mkdir implementations. rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null fi trap '' 0;; esac;; esac if $posix_mkdir && ( umask $mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" ) then : else # The umask is ridiculous, or mkdir does not conform to POSIX, # or it failed possibly due to a race condition. Create the # directory the slow way, step by step, checking for races as we go. case $dstdir in /*) prefix='/';; [-=\(\)!]*) prefix='./';; *) prefix='';; esac oIFS=$IFS IFS=/ set -f set fnord $dstdir shift set +f IFS=$oIFS prefixes= for d do test X"$d" = X && continue prefix=$prefix$d if test -d "$prefix"; then prefixes= else if $posix_mkdir; then (umask=$mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break # Don't fail if two instances are running concurrently. test -d "$prefix" || exit 1 else case $prefix in *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; *) qprefix=$prefix;; esac prefixes="$prefixes '$qprefix'" fi fi prefix=$prefix/ done if test -n "$prefixes"; then # Don't fail if two instances are running concurrently. (umask $mkdir_umask && eval "\$doit_exec \$mkdirprog $prefixes") || test -d "$dstdir" || exit 1 obsolete_mkdir_used=true fi fi fi if test -n "$dir_arg"; then { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 else # Make a couple of temp file names in the proper directory. dsttmp=$dstdir/_inst.$$_ rmtmp=$dstdir/_rm.$$_ # Trap to clean up those temp files at exit. trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 # Copy the file name to the temp name. (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && # and set any options; do chmod last to preserve setuid bits. # # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $cpprog $src $dsttmp" command. # { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && # If -C, don't bother to copy if it wouldn't change the file. if $copy_on_change && old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && set -f && set X $old && old=:$2:$4:$5:$6 && set X $new && new=:$2:$4:$5:$6 && set +f && test "$old" = "$new" && $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 then rm -f "$dsttmp" else # Rename the file to the real destination. $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || # The rename failed, perhaps because mv can't rename something else # to itself, or perhaps because mv is so ancient that it does not # support -f. { # Now remove or move aside any old file at destination location. # We try this two ways since rm can't unlink itself on some # systems and the destination file might be busy for other # reasons. In this case, the final cleanup might fail but the new # file should still install successfully. { test ! -f "$dst" || $doit $rmcmd -f "$dst" 2>/dev/null || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } } || { echo "$0: cannot unlink or rename $dst" >&2 (exit 1); exit 1 } } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dst" } fi || exit 1 trap '' 0 fi done # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: backupninja-1.1.0/lib/0000755000175000017500000000000013315454014011545 500000000000000backupninja-1.1.0/lib/vserver.in0000644000175000017500000001771613230423112013514 00000000000000# -*- mode: sh; sh-basic-offset: 3; indent-tabs-mode: nil; -*- # vim: set filetype=sh sw=3 sts=3 expandtab autoindent: ##################################################### ## VSERVERS RELATED FUNCTIONS FOR NINJAHELPER ## ## Depends on: ## - easydialog library ## - $conffile ## ## Global variables used and modified here: ## - $vservers_are_available (yes/no) ## - $found_vservers (list) ## - $selected_vservers (list) ## - $host_or_vservers (host/vservers/both) ## ## ## Get vservers-related variables. ## Then, if Vservers are enabled, check that: ## - VROOTDIR is valid; ## - at least one vserver can be found. ## If, and only if, the above conditions are all true: ## - set $vservers_are_available to 'yes'; ## - set $found_vservers to the list of all vservers found on the system. ## This function has to be run once before a new helper is run. ## If the argument is "nodialog", use the backupninja's message functions ## instead of easydialog. ## init_vservers() { local arg=$1 # get global variables from the conffile setfile $conffile getconf vservers no getconf VSERVERINFO /usr/sbin/vserver-info getconf VSERVER /usr/sbin/vserver getconf VROOTDIR `if [ -x "$VSERVERINFO" ]; then $VSERVERINFO info SYSINFO | grep '^ *vserver-Rootdir' | @AWK@ '{print $2}'; fi` # canonicalize VROOTDIR [ -z "$VROOTDIR" ] || VROOTDIR=`readlink --canonicalize $VROOTDIR` # init this library's global variables vservers_are_available=no found_vservers= selected_vservers= host_or_vservers=host # check vservers real availability if [ $vservers = yes ]; then if [ ! -x "$VSERVERINFO" ]; then `if [ "$arg" = nodialog ]; then echo fatal; else echo "msgBox warning"; fi` \ "vservers enabled in $conffile, but vserver-info command was not found. Please set the VSERVERINFO configuration variable to its full path." return fi if [ ! -x "$VSERVER" ]; then `if [ "$arg" = nodialog ]; then echo fatal; else echo "msgBox warning"; fi` \ "vservers enabled in $conffile, but vserver command was not found. Please set the VSERVER configuration variable to its full path." return fi if [ -z "$VROOTDIR" ]; then `if [ "$arg" = nodialog ]; then echo fatal; else echo "msgBox warning"; fi` \ "vservers enabled in $conffile, but VROOTDIR is not set and could not be guessed." return fi if [ ! -d "$VROOTDIR" ]; then `if [ "$arg" = nodialog ]; then echo fatal; else echo "msgBox warning"; fi` \ "vservers enabled in $conffile, but VROOTDIR ($VROOTDIR) does not exist."; return fi found_vservers=`ls $VROOTDIR | grep -E -v "lost\+found|ARCHIVES" | tr "\n" " "` if [ -z "$found_vservers" ]; then `if [ "$arg" = nodialog ]; then echo warning; else echo "msgBox warning"; fi` \ "vservers enabled in $conffile, but no vserver was found in $VROOTDIR."; return fi vservers_are_available=yes fi } ## ## If all the arguments are existing vservers names, returns 0. ## Else, returns 1. Also returns 1 if no argument is given. ## vservers_exist() { [ $# -ge 1 ] || return 1 local args="$1" local vserver i found for vserver in $args ; do found=no for i in $found_vservers ; do if [ $vserver = $i ]; then found=yes break fi done [ $found = yes ] || return 1 done return 0 } ## ## If all the arguments are running vservers names, returns 0. ## Else, returns 1. Also returns 1 if no argument is given. ## vservers_running() { [ $# -ge 1 ] || return 1 local args="$1" local vserver for vserver in $args ; do $VSERVERINFO -q $vserver RUNNING || return 1 done return 0 } ## ## If the argument is the name of a vserver selected by the current helper, ## echoes 'on' and returns 0. ## Else, echoes 'off' and returns 1. ## vserver_is_selected() { local vserver=$1 local vserver_is_selected=1 local i for i in $selected_vservers ; do [ "$vserver" == "$i" ] && vserver_is_selected=0 done if [ $vserver_is_selected = 0 ]; then echo on else echo off fi return $vserver_is_selected } ## ## Have the user choose one Vserver among the existing ones. ## Set $selected_vservers to the chosen one's name. ## Returns 1 if cancelled or if Vservers are not available. ## choose_one_vserver() { [ "$vservers_are_available" == "yes" ] || return 1 local title=$1 local i= local vserver= REPLY= while [ -z "$REPLY" ]; do [ -n "$selected_vservers" ] && setDefault $selected_vservers listBegin "$title" "Choose at least one Linux-Vserver to backup:" for vserver in $found_vservers; do listItem "$vserver" "Backup $vserver vserver" done listDisplay menu [ $? = 0 ] || return 1 done selected_vservers=$REPLY } ## ## If Vservers are not enabled, set host_or_vservers='host' and then return ## Else, have the user choose if he/she wants to perform the backup on the host ## system or on one Vserver. ## Set, respectively, $host_or_vservers to 'host' or 'vservers'. ## Returns 1 if cancelled. ## choose_host_or_one_vserver() { if [ "$vservers_are_available" != "yes" ] then host_or_vservers='host' return fi local title=$1 # if there is one, set the previously chosen item as the default [ -n "$host_or_vservers" ] && setDefault $host_or_vservers menuBox "$title - src" "Do you want to operate on the host system and/or on vservers?" \ "host" "Host system" \ "vserver" "One Vserver" [ $? = 0 ] || return 1 case $REPLY in "host") host_or_vservers='host' ;; "vserver") host_or_vservers='vservers' ;; esac } ## ## If Vservers are not enabled, set host_or_vservers='host' and then return ## Else, have the user choose the target he/she wants to perform the backup on: ## - host system only; ## - some vservers only; ## - both the host system and some vservers. ## Set, respectively, $host_or_vservers to 'host', 'vservers', or 'both' ## Returns 1 if cancelled. ## choose_host_or_vservers_or_both() { if [ "$vservers_are_available" != "yes" ] then host_or_vservers='host' return fi local title=$1 # if there is one, set the previously chosen item as the default [ -n "$host_or_vservers" ] && setDefault $host_or_vservers menuBox "$title - src" "Do you want to operate on the host system and/or on vservers?" \ "host" "Host system only" \ "vservers" "Vservers only" \ "both" "Host system and Vservers" [ $? = 0 ] || return 1 case $REPLY in "host") host_or_vservers='host' ;; "vservers") host_or_vservers='vservers' ;; "both") host_or_vservers='both' ;; esac } ## ## Have the user choose among "all vservers" and a not-empty subset of these. ## Set $selected_vservers to 'all' or to a space-separated name list. ## Returns 1 if cancelled or if Vservers are not available. ## choose_one_or_more_vservers() { [ "$vservers_are_available" == "yes" ] || return 1 local title=$1 local i= # UI booleanBox "$title" "Do you want to backup all vservers?" ` [ -z "$selected_vservers" -o "$selected_vservers" == "all" ] || echo no` if [ $? = 0 ]; then selected_vservers="all" else # choose among the existing vservers local vserver= local vserver_was_selected= REPLY= while [ -z "$REPLY" ]; do listBegin "$title" "Choose at least one Linux-Vserver to backup:" # list existing vservers, preselecting the previously selected ones for vserver in $found_vservers; do listItem "$vserver" "Backup $vserver vserver" `vserver_is_selected $vserver` done listDisplay checklist [ $? = 0 ] || return 1 done # remove quotes around each vserver name selected_vservers=`echo $REPLY | tr -d '"'` fi } backupninja-1.1.0/lib/Makefile.am0000644000175000017500000000130013230423112013502 00000000000000my_execbindir = $(pkglibdir) my_execbin_SCRIPTS = easydialog parseini tools vserver CLEANFILES = $(my_execbin_SCRIPTS) EXTRA_DIST = easydialog.in parseini.in tools.in vserver.in edit = sed \ -e "s,@CFGDIR\@,$(CFGDIR),g" \ -e "s,@BASH\@,$(BASH),g" \ -e "s,@AWK\@,$(AWK),g" \ -e "s,@SED\@,$(SED),g" \ -e "s,@MKTEMP\@,$(MKTEMP),g" \ -e "s,@libdir\@,$(pkglibdir),g" easydialog: $(srcdir)/easydialog.in rm -f easydialog $(edit) easydialog.in > easydialog parseini: $(srcdir)/parseini.in rm -f parseini $(edit) parseini.in > parseini tools: $(srcdir)/tools.in rm -f tools $(edit) tools.in > tools vserver: $(srcdir)/vserver.in rm -f vserver $(edit) vserver.in > vserver backupninja-1.1.0/lib/Makefile.in0000644000175000017500000003436213315454012013540 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # 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, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : subdir = lib ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 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) mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(my_execbindir)" SCRIPTS = $(my_execbin_SCRIPTS) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BASH = @BASH@ CFGDIR = @CFGDIR@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ HAVE_RPM = @HAVE_RPM@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MKTEMP = @MKTEMP@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STAT = @STAT@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_cv_have_rpm = @ac_cv_have_rpm@ am__leading_dot = @am__leading_dot@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build_alias = @build_alias@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host_alias = @host_alias@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ my_execbindir = $(pkglibdir) my_execbin_SCRIPTS = easydialog parseini tools vserver CLEANFILES = $(my_execbin_SCRIPTS) EXTRA_DIST = easydialog.in parseini.in tools.in vserver.in edit = sed \ -e "s,@CFGDIR\@,$(CFGDIR),g" \ -e "s,@BASH\@,$(BASH),g" \ -e "s,@AWK\@,$(AWK),g" \ -e "s,@SED\@,$(SED),g" \ -e "s,@MKTEMP\@,$(MKTEMP),g" \ -e "s,@libdir\@,$(pkglibdir),g" all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign lib/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign lib/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-my_execbinSCRIPTS: $(my_execbin_SCRIPTS) @$(NORMAL_INSTALL) @list='$(my_execbin_SCRIPTS)'; test -n "$(my_execbindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(my_execbindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(my_execbindir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n' \ -e 'h;s|.*|.|' \ -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) { files[d] = files[d] " " $$1; \ if (++n[d] == $(am__install_max)) { \ print "f", d, files[d]; n[d] = 0; files[d] = "" } } \ else { print "f", d "/" $$4, $$1 } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(my_execbindir)$$dir'"; \ $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(my_execbindir)$$dir" || exit $$?; \ } \ ; done uninstall-my_execbinSCRIPTS: @$(NORMAL_UNINSTALL) @list='$(my_execbin_SCRIPTS)'; test -n "$(my_execbindir)" || exit 0; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 's,.*/,,;$(transform)'`; \ dir='$(DESTDIR)$(my_execbindir)'; $(am__uninstall_files_from_dir) tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(SCRIPTS) installdirs: for dir in "$(DESTDIR)$(my_execbindir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-my_execbinSCRIPTS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-my_execbinSCRIPTS .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic cscopelist-am \ ctags-am distclean distclean-generic distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-my_execbinSCRIPTS \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic pdf pdf-am ps ps-am tags-am uninstall \ uninstall-am uninstall-my_execbinSCRIPTS .PRECIOUS: Makefile easydialog: $(srcdir)/easydialog.in rm -f easydialog $(edit) easydialog.in > easydialog parseini: $(srcdir)/parseini.in rm -f parseini $(edit) parseini.in > parseini tools: $(srcdir)/tools.in rm -f tools $(edit) tools.in > tools vserver: $(srcdir)/vserver.in rm -f vserver $(edit) vserver.in > vserver # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: backupninja-1.1.0/lib/parseini.in0000644000175000017500000000567613230423112013634 00000000000000# -*- mode: awk; indent-tabs-mode: nil; -*- # # parseini --- parses 'ini' style configuration files. # # Usage: # awk -f parseini S=
P= # # if section is an empty string, then we use the default section # # example ini file: # # fruit = apple # fruit = pear # multiline = this is a multiline \ # parameter # # # this is a comment # [colors] # red = yes # green = no # blue = maybe # # [ocean] # fish = red # fish = blue # # example usage: # > awk -f parseini S=ocean P=fish testfile.ini # would return: # red # blue # BEGIN { readlines = 1 implied = 1 } # remove lines starting with #, but not #! /^#[^!]/ {next} # skip blank /^[ \r\t]*$/ {next} # we want to read the lines of the matched section # and disable for other sections /^\[.+\][ \r\t]*$/ { continueline = 0 if (S && implied) { nline = 0 implied = 0 } if (S && match($0, "^\\[" S "\\][ \n]*")) { # we found the section, so start reading. readlines = 1 } else { # no section, so stop reading lines if (readlines) readlines = 0 } next } # when reading, store lines. { if (!readlines) next line[nline++] = $0 if ($0 ~ /\\[ \r\t]*$/) continueline = 1 else continueline = 0 } # process the read lines lines, matching parameters END { # if section is set but implied is still true # then we never found the section, so use everything if (S && implied) { nline = 0 } # if have P then find P in read lines and get values if (P) { MATCH = "^[ \r\t]*" P "[ \r\t]*=" continueline = 0 for (x = 0; x < nline; ++x) { v = line[x] if (continueline) { sub(/[ \r\t]+$/, "", v) if (v ~ /\\$/) { v = substr(v, 1, length(v)-1) sub(/[ \r\t]+$/, "", v) } if (v) value[nvalue++] = v } else if (v ~ MATCH) { sub(MATCH, "", v) sub(/^[ \r\t]+/, "", v) sub(/[ \r\t]+$/, "", v) if (v ~ /\\$/) { continueline = 1 v = substr(v, 1, length(v)-1) sub(/[ \r\t]+$/, "", v) } if (v) value[nvalue++] = v } } # copy parameter definition to output array nline = nvalue for (x = 0; x < nvalue; ++x) line[x] = value[x] } # trim all leading & trailing whitespace; # except for leading whitespace in continuation lines, for (x = 0; x < nline; ++x) { sub(/^[ \r\t]+/, "", line[x]) sub(/[ \r\t]+$/, "", line[x]) } # output the final result for (x = 0; x < nline; ++x) print line[x] if (nline) exit 0 else exit 1 } backupninja-1.1.0/lib/tools.in0000644000175000017500000000367713230423112013161 00000000000000#!@BASH@ # -*- mode: sh; sh-basic-offset: 3; indent-tabs-mode: nil; -*- # vim: set filetype=sh sw=3 sts=3 expandtab autoindent: # This file contains functions shared between ninjahelper and backupninja. ##################################################### ## MISC FUNCTIONS # # create a temporary file in a secure way. # function maketemp() { local tempfile=`mktemp /tmp/$1.XXXXXXXX` echo $tempfile } # # compare version numbers. # returns 0 if equal, 1 if $1>$2, and 2 if $1<$2 # function compare_versions() { if [[ "$1" == "$2" ]]; then return 0 fi local IFS=. local i version_1=($1) version_2=($2) for ((i=${#version_1[@]}; i<${#version_2[@]}; i++)); do version_1[i]=0 done for ((i=0; i<${#version_1[@]}; i++)); do if [[ -z ${version_2[i]} ]]; then version_2[i]=0 fi if ((10#${version_1[i]} > 10#${version_2[i]})); then return 1 fi if ((10#${version_1[i]} < 10#${version_2[i]})); then return 2 fi done return 0 } # # compare version numbers: >= # function version_ge() { compare_versions "$1" "$2" comp=$? [ $comp -eq 0 ] || [ $comp -eq 1 ] } ##################################################### ## CONFIG-FILE RELATED FUNCTIONS function setfile() { CURRENT_CONF_FILE=$1 } function setsection() { CURRENT_SECTION=$1 } # # sets a global var with name equal to $1 # to the value of the configuration parameter $1 # $2 is the default. # function getconf() { CURRENT_PARAM=$1 ret=`@AWK@ -f $libdirectory/parseini S=$CURRENT_SECTION P=$CURRENT_PARAM $CURRENT_CONF_FILE` # if nothing is returned, set the default if [ "$ret" == "" -a "$2" != "" ]; then ret="$2" fi # replace * with %, so that it is not globbed. ret="${ret//\\*/__star__}" # this is weird, but single quotes are needed to # allow for returned values with spaces. $ret is still expanded # because it is in an 'eval' statement. eval $1='$ret' } backupninja-1.1.0/lib/easydialog.in0000644000175000017500000001462713230423112014137 00000000000000#!@BASH@ # -*- mode: sh; sh-basic-offset: 3; indent-tabs-mode: nil; -*- # vim: set filetype=sh sw=3 sts=3 expandtab autoindent: # copyright 2002 lmoore@tump.com under the terms of the GNU LGPL. # additions 2005 collective@riseup.net # whiptail has trouble being called in the foo=$(whiptail ...) fashion for # some reason. this is very annoying. this means that we need to use # temporary files to store the answers from the input and list based boxes # and then read the answers into a REPLY variable. that just really # stinks, oh well, that's what you get when you have a weak link # implementation... # # inputBox and passwordBox could be refactored to use a common function test -z "$WIDTH" && WIDTH=0 test -z "$HEIGHT" && HEIGHT=0 BACKTITLE="" DIALOG=dialog HELP= setApplicationTitle() { BACKTITLE=$* } setHelp() { HELP="$@" } setDimension() { WIDTH=$1 HEIGHT=$2 } booleanBox() { $DIALOG --backtitle "$BACKTITLE" --title "$1" \ `[ "$3" == no ] && echo '--defaultno'` --yesno "$2" $HEIGHT $WIDTH } msgBox() { $DIALOG --backtitle "$BACKTITLE" --title "$1" \ --msgbox "$2" $HEIGHT $WIDTH } gaugeBox() { $DIALOG --backtitle "$BACKTITLE" --title "$1" \ --gauge "$2" $HEIGHT $WIDTH 0 } inputBox() { local temp=$(@MKTEMP@ -t backupninja.XXXXXX) || exit 1 trap "rm -f $temp" 0 REPLY= $DIALOG --backtitle "$BACKTITLE" --title "$1" \ --inputbox "$2" $HEIGHT $WIDTH "$3" 2> $temp local status=$? [ $status = 0 ] && REPLY=$(cat $temp) rm -f $temp return $status } # Xdialog and {dialog,whiptail} use different mechanism to "qoute" the # values from a checklist. {dialog,whiptail} uses standard double quoting # while Xdialog uses a "/" as the separator. the slash is arguably better, # but the double quoting is more standard. anyway, this function can be # overridden to allow a derived implementation to change it's quoting # mechanism to the standard double-quoting one. it receives two # arguements, the file that has the data and the box type. _listReplyHook() { cat $1 } # this is the base implementation of all the list based boxes, it works # out nicely that way. the real function just passes it's arguments to # this function with an extra argument specifying the actual box that # needs to be rendered. _genericListBox() { local box=$1 shift 1 local title=$1 local text=$2 shift 2 local temp=$(@MKTEMP@ -t backupninja.XXXXXX) || exit 1 trap "rm -f $temp" 0 REPLY= $DIALOG $HELP $_DEFAULT --backtitle "$BACKTITLE" --title "$title" \ $box "$text" $HEIGHT $WIDTH 10 \ "$@" 2> $temp local status=$? [ $status = 0 ] && REPLY=$(_listReplyHook $temp $box) rm -f $temp _DEFAULT= return $status } setDefault() { _DEFAULT="--default-item $1" } menuBox() { _genericListBox --menu "$@" } ## a menu box with additional help info displayed ## at the bottom of the window when an item is selected menuBoxHelp() { HELP="--item-help" _genericListBox --menu "$@" status=$? HELP= return $status } ## a menu box with an addition button 'help' menuBoxHelpFile() { HELP="--help-button" _genericListBox --menu "$@" status=$? HELP= return $status } checkBox() { _genericListBox --checklist "$@" } radioBox() { _genericListBox --radiolist "$@" } textBox() { $DIALOG --backtitle "$BACKTITLE" --title "$1" --textbox "$2" $HEIGHT $WIDTH } passwordBox() { local temp=$(@MKTEMP@ -t backupninja.XXXXXX) || exit 1 trap "rm -f $temp" 0 REPLY= $DIALOG --backtitle "$BACKTITLE" --title "$1" \ --passwordbox "$2" $HEIGHT $WIDTH 2> $temp local status=$? [ $status = 0 ] && REPLY=$(cat $temp) rm -f $temp return $status } ######################################################### ## begin-item-display style lists ## ## these lists are built by calling fuctions multiple times. ## this can make it easier to build your list in a loop ## listBegin() { _menu_title=$1 _menu_msg=$2 _menu_items=0 _menu_text= _menu_labels= _menu_status= } listItem() { _menu_labels[$_menu_items]=$1 _menu_text[$_menu_items]=$2 _menu_status[$_menu_items]=$3 # available only for checklist let "_menu_items += 1" } ## ## takes one of: ## menu, checklist, radiolist ## listDisplay() { boxtype=$1 local temp=$(@MKTEMP@ -t backupninja.XXXXXX) || exit 1 trap "rm -f $temp" 0 local label local text local status ( echo -ne " $HELP $_DEFAULT " echo -ne " --backtitle '$BACKTITLE' " echo -ne " --title '$_menu_title' " echo -ne " --$boxtype '$_menu_msg' " echo -ne " $HEIGHT $WIDTH 10 " for ((i=0; i < $_menu_items ; i++)); do label=${_menu_labels[$i]} text=${_menu_text[$i]} status=${_menu_status[$i]} echo -ne " $label '$text' $status " done ) | xargs $DIALOG 2> $temp local status=$? REPLY="" [ $status = 0 ] && REPLY=`cat $temp` rm -f $temp _DEFAULT= return $status } #################################################### ## FORM _form_gap=2 formBegin() { _form_title=$1 _form_items=0 _form_labels= _form_text= } formItem() { _form_labels[$_form_items]=$1 _form_text[$_form_items]=$2 let "_form_items += 1" } formDisplay() { local temp=$(@MKTEMP@ -t backupninja.XXXXXX) || exit 1 max_length=0 for ((i=0; i < ${#_form_labels[@]} ; i++)); do label=${_form_labels[$i]} length=`expr length $label` if [ $length -gt $max_length ]; then max_length=$length fi done let "max_length += 2" local xpos=1 ( echo -n -e "--form '$_form_title' 0 0 20" for ((i=0; i < $_form_items ; i++)); do label=${_form_labels[$i]} text=${_form_text[$i]} echo -n -e " $label $xpos 1 '$text' $xpos $max_length 30 100" let "xpos += _form_gap" done ) | xargs $DIALOG 2> $temp local status=$? ## ## the exit status is meaningless, it is always 0. ## i can't figure out how to get the exit status of dialog ## if we do "dialog `arg code`" or "dialog $args", then the quotes ## get messed up and dialog won't run. ## if we do "(arg code) | xargs dialog", then the exit status is ## swallowed by xargs. xargs should return different exit status ## depending on the exit status of the command run, but i have ## never been able to get that to work. ## REPLY= if [ $status = 0 ]; then IFS=$'' REPLY=`cat $temp` IFS=$' \t\n' fi rm -f $temp return $status } backupninja-1.1.0/src/0000755000175000017500000000000013315454014011566 500000000000000backupninja-1.1.0/src/ninjareport.in0000755000175000017500000001246413230423112014372 00000000000000#!@BASH@ # -*- mode: sh; sh-basic-offset: 3; indent-tabs-mode: nil; -*- # vim: set filetype=sh sw=3 sts=3 expandtab autoindent: # # # Ninjareport - generate a single simple report for a lot of hosts # # requires logtail # # Copyright (C) 2007 - riseup.net -- property is theft. # TODO: # # . check for logs that are never updating and warn # . change constantly updating logs (maildir) to be more friendly # . documentation # . maybe make config option that lists all hosts that should report-in, and if # one doesn't then warn # . restrict rsync somehow? # . abstract path for logtail # . on the report master, the reportdirectory should be set where the reports will be going, note this mail=1 display=0 process() { # look in the logfile for any lines like the following: # Jan 20 01:02:46 Info: FINISHED: 2 actions run. 0 fatal. 0 error. 0 warning. # # note: some backups never finish, such as the maildir one, need to handle these # perhaps by looking for FAILED messages? # note2: what about logs that aren't being updated? this is a failure case and # should be looked for # note3: there are also these entries: # Jan 20 14:00:01 Fatal: No backup actions configured in '/etc/backup.d', run ninjahelper! # The following has to be done without invoking a subshell (see BashFAQ #24) logupdates=`maketemp ninjadata` /usr/sbin/logtail -f $host > $logupdates grep FINISHED $logupdates | ( fatal=0 warning=0 error=0 while read line do line_array=($line) fatal=$(($fatal + ${line_array[8]})) error=$(($error + ${line_array[10]})) warning=$(($warning + ${line_array[12]})) done if (( $fatal || $warning || $error )); then echo "`basename $host .log`: $fatal fatals found, $error errors found, $warning warnings found" >> $statusfile echo "" >> $reportappend echo "`basename $host .log` log entries since last ninjareport" >> $reportappend echo "---------" >> $reportappend cat $logupdates >> $reportappend rm $logupdates fi ) } generatereport() { reportfile=`maketemp ninjareport` # Generate a report, only if there are failures if [ -s $statusfile ]; then echo " backupninja mission failures - `date`" >> $reportfile echo " --------------------------------------------------------------" >> $reportfile echo "" >> $reportfile cat $statusfile | column -t >> $reportfile echo "" >> $reportfile echo " log entries from failed reports" >> $reportfile echo " -----------------------------------" >> $reportfile cat $reportappend >> $reportfile fi } usage() { cat << EOF This script generates a backupninja status report for all configured systems. It requires that each status report is placed in a spot where ninjareport can read it, reports are mailed to the reportemail configured in @CFGDIR@/backupninja.conf. The following options are available: -h, --help This usage message -f, --conffile FILE Use FILE for the configuration instead of @CFGDIR@/backupninja.conf -m, --mail Mail the report to this address -o, --out Don't mail the report, just display it EOF } ##################################################### ## MAIN conffile="@CFGDIR@/backupninja.conf" ## process command line options while [ $# -ge 1 ]; do case $1 in -h|--help) usage exit 0 ;; -f|--conffile) if [ -f $2 ]; then conffile=$2 else echo "-f|--conffile option must be followed by an existing filename" fatal "-f|--conffile option must be followed by an existing filename" usage fi # we shift here to avoid processing the file path shift ;; -m|--mail) reportemail=$2 shift ;; -o|--out) mail=0 display=1 ;; *) echo "Unknown option $1" usage exit ;; esac shift done ## Load and confirm basic configuration values # bootstrap if [ ! -r "$conffile" ]; then echo "Configuration file $conffile not found." fatal "Configuration file $conffile not found." fi # find $libdirectory libdirectory=`grep '^libdirectory' $conffile | awk '{print $3}'` if [ -z "$libdirectory" ]; then if [ -d "@libdir@" ]; then libdirectory="@libdir@" else echo "Could not find entry 'libdirectory' in $conffile." exit 1 fi else if [ ! -d "$libdirectory" ]; then echo "Lib directory $libdirectory not found." exit 1 fi fi # include shared functions . $libdirectory/tools setfile $conffile getconf reportdirectory getconf reportemail ## Process each configuration file hosts=`find $reportdirectory -follow -mindepth 1 -maxdepth 1 -type f ! -name '*.offset' | sort -n` if [ -z "$hosts" ]; then echo "Fatal: No backupninja reports found in '$reportdirectory'!" mail=0 fi statusfile=`maketemp ninjastatus` reportappend=`maketemp ninjaappend` for host in $hosts; do [ -f "$host" ] || continue # Check somehow that the file is a valid report file process $host done generatereport ## mail the report to the report address or display it if [ -s $reportfile ]; then if [ $mail == 1 ]; then mail -s "backupninja mission failure report" $reportemail < $reportfile fi fi if [ $display == 1 ]; then cat $reportfile fi backupninja-1.1.0/src/Makefile.am0000644000175000017500000000164613230423112013540 00000000000000# tyhle vygenerujeme ... sbin_SCRIPTS = backupninja ninjahelper # a proto je taky musíme smazat ... CLEANFILES = $(sbin_SCRIPTS) EXTRA_DIST = backupninja.in ninjahelper.in ninjareport.in edit = sed \ -e "s,@CFGDIR\@,$(CFGDIR),g" \ -e "s,@BASH\@,$(BASH),g" \ -e "s,@AWK\@,$(AWK),g" \ -e "s,@SED\@,$(SED),g" \ -e "s,@STAT\@,$(STAT),g" \ -e 's,@datadir\@,$(pkgdatadir),g' \ -e "s,@libdir\@,$(pkglibdir),g" \ -e 's,@localstatedir\@,$(localstatedir),g' \ -e 's,@prefix\@,$(prefix),g' #install-exec-hook: backupninja: $(srcdir)/backupninja.in rm -f backupninja $(edit) $(srcdir)/backupninja.in > backupninja chmod ugo+x backupninja ninjahelper: $(srcdir)/ninjahelper.in rm -f ninjahelper $(edit) $(srcdir)/ninjahelper.in > ninjahelper chmod ugo+x ninjahelper ninjareport: $(srcdir)/ninjareport.in rm -f ninjareport $(edit) $(srcdir)/ninjareport.in > ninjareport chmod ugo+x ninjareport backupninja-1.1.0/src/Makefile.in0000644000175000017500000003454713315454012013566 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # 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, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : subdir = src ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 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) mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(sbindir)" SCRIPTS = $(sbin_SCRIPTS) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BASH = @BASH@ CFGDIR = @CFGDIR@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ HAVE_RPM = @HAVE_RPM@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MKTEMP = @MKTEMP@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STAT = @STAT@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_cv_have_rpm = @ac_cv_have_rpm@ am__leading_dot = @am__leading_dot@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build_alias = @build_alias@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host_alias = @host_alias@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ # tyhle vygenerujeme ... sbin_SCRIPTS = backupninja ninjahelper # a proto je taky musíme smazat ... CLEANFILES = $(sbin_SCRIPTS) EXTRA_DIST = backupninja.in ninjahelper.in ninjareport.in edit = sed \ -e "s,@CFGDIR\@,$(CFGDIR),g" \ -e "s,@BASH\@,$(BASH),g" \ -e "s,@AWK\@,$(AWK),g" \ -e "s,@SED\@,$(SED),g" \ -e "s,@STAT\@,$(STAT),g" \ -e 's,@datadir\@,$(pkgdatadir),g' \ -e "s,@libdir\@,$(pkglibdir),g" \ -e 's,@localstatedir\@,$(localstatedir),g' \ -e 's,@prefix\@,$(prefix),g' all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign src/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-sbinSCRIPTS: $(sbin_SCRIPTS) @$(NORMAL_INSTALL) @list='$(sbin_SCRIPTS)'; test -n "$(sbindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(sbindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(sbindir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n' \ -e 'h;s|.*|.|' \ -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) { files[d] = files[d] " " $$1; \ if (++n[d] == $(am__install_max)) { \ print "f", d, files[d]; n[d] = 0; files[d] = "" } } \ else { print "f", d "/" $$4, $$1 } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(sbindir)$$dir'"; \ $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(sbindir)$$dir" || exit $$?; \ } \ ; done uninstall-sbinSCRIPTS: @$(NORMAL_UNINSTALL) @list='$(sbin_SCRIPTS)'; test -n "$(sbindir)" || exit 0; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 's,.*/,,;$(transform)'`; \ dir='$(DESTDIR)$(sbindir)'; $(am__uninstall_files_from_dir) tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(SCRIPTS) installdirs: for dir in "$(DESTDIR)$(sbindir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-sbinSCRIPTS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-sbinSCRIPTS .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic cscopelist-am \ ctags-am distclean distclean-generic distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-sbinSCRIPTS install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ pdf-am ps ps-am tags-am uninstall uninstall-am \ uninstall-sbinSCRIPTS .PRECIOUS: Makefile #install-exec-hook: backupninja: $(srcdir)/backupninja.in rm -f backupninja $(edit) $(srcdir)/backupninja.in > backupninja chmod ugo+x backupninja ninjahelper: $(srcdir)/ninjahelper.in rm -f ninjahelper $(edit) $(srcdir)/ninjahelper.in > ninjahelper chmod ugo+x ninjahelper ninjareport: $(srcdir)/ninjareport.in rm -f ninjareport $(edit) $(srcdir)/ninjareport.in > ninjareport chmod ugo+x ninjareport # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: backupninja-1.1.0/src/backupninja.in0000755000175000017500000004606013315451520014333 00000000000000#!@BASH@ # -*- mode: sh; sh-basic-offset: 3; indent-tabs-mode: nil; -*- # vim: set filetype=sh sw=3 sts=3 expandtab autoindent: # # |\_ # B A C K U P N I N J A /()/ # `\| # # Copyright (C) 2004-05 riseup.net -- property is theft. # # 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. # ##################################################### ## FUNCTIONS function setupcolors () { BLUE="\033[34;01m" GREEN="\033[32;01m" YELLOW="\033[33;01m" PURPLE="\033[35;01m" RED="\033[31;01m" OFF="\033[0m" CYAN="\033[36;01m" COLORS=($BLUE $GREEN $YELLOW $RED $PURPLE $CYAN) } function colorize () { if [ "$usecolors" == "yes" ]; then local typestr=`echo "$@" | @SED@ 's/\(^[^:]*\).*$/\1/'` [ "$typestr" == "Debug" ] && type=0 [ "$typestr" == "Info" ] && type=1 [ "$typestr" == "Warning" ] && type=2 [ "$typestr" == "Error" ] && type=3 [ "$typestr" == "Fatal" ] && type=4 [ "$typestr" == "Halt" ] && type=5 color=${COLORS[$type]} endcolor=$OFF echo -e "$color$@$endcolor" else echo -e "$@" fi } # We have the following message levels: # 0 - debug - blue # 1 - normal messages - green # 2 - warnings - yellow # 3 - errors - red # 4 - fatal - purple # 5 - halt - cyan # First variable passed is the error level, all others are printed # if 1, echo out all warnings, errors, or fatal # used to capture output from handlers echo_debug_msg=0 usecolors=yes function printmsg() { [ ${#@} -gt 1 ] || return type=$1 shift if [ $type == 100 ]; then typestr=`echo "$@" | @SED@ 's/\(^[^:]*\).*$/\1/'` [ "$typestr" == "Debug" ] && type=0 [ "$typestr" == "Info" ] && type=1 [ "$typestr" == "Warning" ] && type=2 [ "$typestr" == "Error" ] && type=3 [ "$typestr" == "Fatal" ] && type=4 [ "$typestr" == "Halt" ] && type=5 typestr="" else types=(Debug Info Warning Error Fatal Halt) typestr="${types[$type]}: " fi print=$[4-type] if [ $echo_debug_msg == 1 ]; then echo -e "$typestr$@" >&2 elif [ $debug ]; then colorize "$typestr$@" >&2 fi if [ $print -lt $loglevel ]; then logmsg "$typestr$@" fi } function logmsg() { if [ -w "$logfile" ]; then echo -e `LC_ALL=C date "+%h %d %H:%M:%S"` "$@" >> $logfile fi } function passthru() { printmsg 100 "$@" } function debug() { printmsg 0 "$@" } function info() { printmsg 1 "$@" } function warning() { printmsg 2 "$@" } function error() { printmsg 3 "$@" } function fatal() { printmsg 4 "$@" exit 2 } function halt() { printmsg 5 "$@" exit 2 } msgcount=0 function msg { messages[$msgcount]=$1 let "msgcount += 1" } # # enforces very strict permissions on configuration file $file. # function check_perms() { local file=$1 debug "check_perms $file" local perms local owners perms=($(@STAT@ -L --format='%A' $file)) debug "perms: $perms" local gperm=${perms:4:3} debug "gperm: $gperm" local wperm=${perms:7:3} debug "wperm: $wperm" owners=($(@STAT@ -L --format='%g %G %u %U' $file)) local gid=${owners[0]} local group=${owners[1]} local owner=${owners[2]} if [ "$owner" != 0 ]; then echo "Configuration files must be owned by root! Dying on file $file" fatal "Configuration files must be owned by root! Dying on file $file" fi if [ "$wperm" != '---' ]; then echo "Configuration files must not be world writable/readable! Dying on file $file" fatal "Configuration files must not be world writable/readable! Dying on file $file" fi if [ "$gperm" != '---' ]; then case "$admingroup" in $gid|$group) :;; *) if [ "$gid" != 0 ]; then echo "Configuration files must not be writable/readable by group $group! Use the admingroup option in backupninja.conf. Dying on file $file" fatal "Configuration files must not be writable/readable by group $group! Use the admingroup option in backupninja.conf. Dying on file $file" fi ;; esac fi } # simple lowercase function function tolower() { echo "$1" | tr '[:upper:]' '[:lower:]' } # simple to integer function function toint() { echo "$1" | tr -d '[:alpha:]' } # # function isnow(): returns 1 if the time/day passed as $1 matches # the current time/day. # # format is at