From 8000beda168ec59df4f8cc69e72cb6e9722368eb Mon Sep 17 00:00:00 2001 From: Micah Anderson Date: Thu, 9 Jul 2009 19:00:41 -0400 Subject: added sshoptions variable to the maildir handler for arbitrary options that you might need to pass updated the example.maildir to include this option, as well as detail the missing desid_file, destport --- ChangeLog | 2 ++ 1 file changed, 2 insertions(+) (limited to 'ChangeLog') diff --git a/ChangeLog b/ChangeLog index f1daeb9..74cc3ca 100644 --- a/ChangeLog +++ b/ChangeLog @@ -9,6 +9,8 @@ version 0.9.7 -- UNRELEASED 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 mysql: . Options passed to mysqldump are now customizable with the new sqldumpoptions configuration variable. Thanks to Chris Lamb for his -- cgit v1.2.3 From f45803230a839de092122f6843422097deff4eaa Mon Sep 17 00:00:00 2001 From: intrigeri Date: Sat, 18 Jul 2009 10:45:45 +0200 Subject: dup: fixed bandwidthlimit test Thanks to Ian Beckwith for the patch. --- AUTHORS | 1 + ChangeLog | 3 +++ handlers/dup.in | 2 +- 3 files changed, 5 insertions(+), 1 deletion(-) (limited to 'ChangeLog') diff --git a/AUTHORS b/AUTHORS index dc0d2bd..c5fdf33 100644 --- a/AUTHORS +++ b/AUTHORS @@ -29,3 +29,4 @@ Adam Monsen - spec file updates Matthew Palmer -- halt loglevel feature dan@garthwaite.org -- reportspace bugfix Tuomas Jormola -- "when = manual" option +Ian Beckwith -- dup bandwidthlimit fix diff --git a/ChangeLog b/ChangeLog index 74cc3ca..c91ca38 100644 --- a/ChangeLog +++ b/ChangeLog @@ -26,6 +26,9 @@ version 0.9.7 -- UNRELEASED . 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. version 0.9.6 -- July 21, 2008 backupninja changes diff --git a/handlers/dup.in b/handlers/dup.in index aed6030..54b7709 100644 --- a/handlers/dup.in +++ b/handlers/dup.in @@ -106,7 +106,7 @@ duplicity_sub="`echo $duplicity_version | @AWK@ -F '.' '{print $3}'`" # --sftp-command ourselves scpoptions="$sshoptions" -if [ "$bandwidthlimit" =! 0 ]; then +if [ "$bandwidthlimit" != 0 ]; then [ -z "$testurl" ] || warning 'The bandwidthlimit option is not used when desturl is set.' scpoptions="$scpoptions -l $bandwidthlimit" fi -- cgit v1.2.3 From f9672647177f771270f40a858fb94283ff1ebcdf Mon Sep 17 00:00:00 2001 From: intrigeri Date: Thu, 19 Nov 2009 20:27:46 +0100 Subject: ldap, mysql, pgsql: use gzip's --rsyncable option --- ChangeLog | 5 +++++ handlers/ldap.in | 2 +- handlers/mysql.in | 4 ++-- handlers/pgsql.in | 8 ++++---- 4 files changed, 12 insertions(+), 7 deletions(-) (limited to 'ChangeLog') diff --git a/ChangeLog b/ChangeLog index c91ca38..4a4a3b1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -6,6 +6,8 @@ version 0.9.7 -- UNRELEASED file or in a given backup action file. Thanks Tuomas Jormola for the preliminary patch (Closes: #511299) handler changes + ldap: + . Use gzip's --rsyncable option. maildir: . fix location of deleted_on file . add missing destid_file options to ssh connections @@ -20,6 +22,9 @@ version 0.9.7 -- UNRELEASED 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. + pgsql: + . Use gzip's --rsyncable option. sys: . New luksheaders option (default=disabled) to backup the Luks header of every Luks device. diff --git a/handlers/ldap.in b/handlers/ldap.in index 5f402c7..853cefb 100644 --- a/handlers/ldap.in +++ b/handlers/ldap.in @@ -86,7 +86,7 @@ if [ "$ldif" == "yes" ]; then fi if [ "$compress" == "yes" ]; then - execstr="$execstr | $GZIP > $dumpdir/$dbsuffix.ldif.gz" + execstr="$execstr | $GZIP --rsyncable > $dumpdir/$dbsuffix.ldif.gz" else execstr="$execstr > $dumpdir/$dbsuffix.ldif" fi diff --git a/handlers/mysql.in b/handlers/mysql.in index 88ffb1a..e1e89b0 100644 --- a/handlers/mysql.in +++ b/handlers/mysql.in @@ -272,7 +272,7 @@ then fatal "mysqld doesn't appear to be running!" fi if [ "$compress" == "yes" ]; then - execstr="$VSERVER $vsname exec $DUMP | $GZIP > $vroot$dumpdir/${db}.sql.gz" + execstr="$VSERVER $vsname exec $DUMP | $GZIP --rsyncable > $vroot$dumpdir/${db}.sql.gz" else execstr="$VSERVER $vsname exec $DUMP -r $vroot$dumpdir/${db}.sql" fi @@ -283,7 +283,7 @@ then fatal "mysqld doesn't appear to be running!" fi if [ "$compress" == "yes" ]; then - execstr="$DUMP | $GZIP > $dumpdir/${db}.sql.gz" + execstr="$DUMP | $GZIP --rsyncable > $dumpdir/${db}.sql.gz" else execstr="$DUMP -r $dumpdir/${db}.sql" fi diff --git a/handlers/pgsql.in b/handlers/pgsql.in index ff5f7ba..a7e3ec2 100644 --- a/handlers/pgsql.in +++ b/handlers/pgsql.in @@ -75,13 +75,13 @@ chmod 700 $vroot$backupdir if [ "$databases" == "all" ]; then if [ $usevserver = yes ]; then if [ "$compress" == "yes" ]; then - execstr="$VSERVER $vsname exec su - $PGSQLUSER -c \"$PGSQLDUMPALL | $GZIP > $backupdir/${vsname}.sql.gz\"" + execstr="$VSERVER $vsname exec su - $PGSQLUSER -c \"$PGSQLDUMPALL | $GZIP --rsyncable > $backupdir/${vsname}.sql.gz\"" else execstr="$VSERVER $vsname exec su - $PGSQLUSER -c \"$PGSQLDUMPALL > $backupdir/${vsname}.sql\"" fi else if [ "$compress" == "yes" ]; then - execstr="su - $PGSQLUSER -c \"$PGSQLDUMPALL | $GZIP > $backupdir/${localhost}-all.sql.gz\"" + execstr="su - $PGSQLUSER -c \"$PGSQLDUMPALL | $GZIP --rsyncable > $backupdir/${localhost}-all.sql.gz\"" else execstr="su - $PGSQLUSER -c \"$PGSQLDUMPALL > $backupdir/${localhost}-all.sql\"" fi @@ -104,13 +104,13 @@ else for db in $databases; do if [ $usevserver = yes ]; then if [ "$compress" == "yes" ]; then - execstr="$VSERVER $vsname exec su - $PGSQLUSER -c \"$PGSQLDUMP $db | $GZIP > $backupdir/${db}.sql.gz\"" + execstr="$VSERVER $vsname exec su - $PGSQLUSER -c \"$PGSQLDUMP $db | $GZIP --rsyncable > $backupdir/${db}.sql.gz\"" else execstr="$VSERVER $vsname exec su - $PGSQLUSER -c \"$PGSQLDUMP $db | > $backupdir/${db}.sql\"" fi else if [ "$compress" == "yes" ]; then - execstr="su - $PGSQLUSER -c \"$PGSQLDUMP $db | $GZIP > $backupdir/${db}.sql.gz\"" + execstr="su - $PGSQLUSER -c \"$PGSQLDUMP $db | $GZIP --rsyncable > $backupdir/${db}.sql.gz\"" else execstr="su - $PGSQLUSER -c \"$PGSQLDUMP $db > $backupdir/${db}.sql\"" fi -- cgit v1.2.3 From 6606cce4454fc040c60889db82c274704d840ec8 Mon Sep 17 00:00:00 2001 From: intrigeri Date: Thu, 24 Dec 2009 16:57:31 +0100 Subject: easydialog: allow form fields input to grow up to 100 chars (Closes: #562249) --- ChangeLog | 3 +++ lib/easydialog.in | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'ChangeLog') diff --git a/ChangeLog b/ChangeLog index 4a4a3b1..9a6ccaa 100644 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,9 @@ version 0.9.7 -- UNRELEASED . 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) + lib changes + easydialog: + . Allow form fields input to grow up to 100 chars (Closes: #562249) handler changes ldap: . Use gzip's --rsyncable option. diff --git a/lib/easydialog.in b/lib/easydialog.in index c41e6f7..6b41e1b 100644 --- a/lib/easydialog.in +++ b/lib/easydialog.in @@ -240,7 +240,7 @@ formDisplay() { 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 30" + echo -n -e " $label $xpos 1 '$text' $xpos $max_length 30 100" let "xpos += _form_gap" done ) | xargs $DIALOG 2> $temp -- cgit v1.2.3 From f4ab3148f175f8ac415b01fea61d14a80f4de969 Mon Sep 17 00:00:00 2001 From: intrigeri Date: Fri, 25 Dec 2009 02:33:13 +0100 Subject: mysql, pgsql: Quote output filenames ... to support shell meta-characters in database names. Closes Redmine bug #617. --- ChangeLog | 4 ++++ NEWS | 9 +++++++++ handlers/mysql.in | 8 ++++---- handlers/pgsql.in | 16 ++++++++-------- 4 files changed, 25 insertions(+), 12 deletions(-) (limited to 'ChangeLog') diff --git a/ChangeLog b/ChangeLog index 9a6ccaa..97d4353 100644 --- a/ChangeLog +++ b/ChangeLog @@ -26,8 +26,12 @@ version 0.9.7 -- UNRELEASED . 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. pgsql: . Use gzip's --rsyncable option. + . Quote output filenames to support shell meta-characters in + database names. sys: . New luksheaders option (default=disabled) to backup the Luks header of every Luks device. diff --git a/NEWS b/NEWS index 361cf3c..ef8592e 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,12 @@ +backupninja (0.9.7-1) UNRELEASED + + * mysql: output filenames to support shell meta-characters in + database names. This change was not heavily tested, please + report any breakage. + * pgsql: output filenames to support shell meta-characters in + database names. This change was not heavily tested, please + report any breakage. + backupninja (0.9.4-1) UNRELEASED * duplicity: Old (pre-0.9.4) example.dup file used to give false diff --git a/handlers/mysql.in b/handlers/mysql.in index e1e89b0..0aa3abb 100644 --- a/handlers/mysql.in +++ b/handlers/mysql.in @@ -272,9 +272,9 @@ then fatal "mysqld doesn't appear to be running!" fi if [ "$compress" == "yes" ]; then - execstr="$VSERVER $vsname exec $DUMP | $GZIP --rsyncable > $vroot$dumpdir/${db}.sql.gz" + execstr="$VSERVER $vsname exec $DUMP | $GZIP --rsyncable > '$vroot$dumpdir/${db}.sql.gz'" else - execstr="$VSERVER $vsname exec $DUMP -r $vroot$dumpdir/${db}.sql" + execstr="$VSERVER $vsname exec $DUMP -r '$vroot$dumpdir/${db}.sql'" fi else # Test to make sure mysqld is running, if it is not sqldump will not work @@ -283,9 +283,9 @@ then fatal "mysqld doesn't appear to be running!" fi if [ "$compress" == "yes" ]; then - execstr="$DUMP | $GZIP --rsyncable > $dumpdir/${db}.sql.gz" + execstr="$DUMP | $GZIP --rsyncable > '$dumpdir/${db}.sql.gz'" else - execstr="$DUMP -r $dumpdir/${db}.sql" + execstr="$DUMP -r '$dumpdir/${db}.sql'" fi fi debug "su $user -c \"$execstr\"" diff --git a/handlers/pgsql.in b/handlers/pgsql.in index a7e3ec2..d7839fb 100644 --- a/handlers/pgsql.in +++ b/handlers/pgsql.in @@ -75,15 +75,15 @@ chmod 700 $vroot$backupdir if [ "$databases" == "all" ]; then if [ $usevserver = yes ]; then if [ "$compress" == "yes" ]; then - execstr="$VSERVER $vsname exec su - $PGSQLUSER -c \"$PGSQLDUMPALL | $GZIP --rsyncable > $backupdir/${vsname}.sql.gz\"" + execstr="$VSERVER $vsname exec su - $PGSQLUSER -c \"$PGSQLDUMPALL | $GZIP --rsyncable > '$backupdir/${vsname}.sql.gz'\"" else - execstr="$VSERVER $vsname exec su - $PGSQLUSER -c \"$PGSQLDUMPALL > $backupdir/${vsname}.sql\"" + execstr="$VSERVER $vsname exec su - $PGSQLUSER -c \"$PGSQLDUMPALL > '$backupdir/${vsname}.sql'\"" fi else if [ "$compress" == "yes" ]; then - execstr="su - $PGSQLUSER -c \"$PGSQLDUMPALL | $GZIP --rsyncable > $backupdir/${localhost}-all.sql.gz\"" + execstr="su - $PGSQLUSER -c \"$PGSQLDUMPALL | $GZIP --rsyncable > '$backupdir/${localhost}-all.sql.gz'\"" else - execstr="su - $PGSQLUSER -c \"$PGSQLDUMPALL > $backupdir/${localhost}-all.sql\"" + execstr="su - $PGSQLUSER -c \"$PGSQLDUMPALL > '$backupdir/${localhost}-all.sql'\"" fi fi debug "$execstr" @@ -104,15 +104,15 @@ else for db in $databases; do if [ $usevserver = yes ]; then if [ "$compress" == "yes" ]; then - execstr="$VSERVER $vsname exec su - $PGSQLUSER -c \"$PGSQLDUMP $db | $GZIP --rsyncable > $backupdir/${db}.sql.gz\"" + execstr="$VSERVER $vsname exec su - $PGSQLUSER -c \"$PGSQLDUMP $db | $GZIP --rsyncable > '$backupdir/${db}.sql.gz'\"" else - execstr="$VSERVER $vsname exec su - $PGSQLUSER -c \"$PGSQLDUMP $db | > $backupdir/${db}.sql\"" + execstr="$VSERVER $vsname exec su - $PGSQLUSER -c \"$PGSQLDUMP $db | > '$backupdir/${db}.sql'\"" fi else if [ "$compress" == "yes" ]; then - execstr="su - $PGSQLUSER -c \"$PGSQLDUMP $db | $GZIP --rsyncable > $backupdir/${db}.sql.gz\"" + execstr="su - $PGSQLUSER -c \"$PGSQLDUMP $db | $GZIP --rsyncable > '$backupdir/${db}.sql.gz'\"" else - execstr="su - $PGSQLUSER -c \"$PGSQLDUMP $db > $backupdir/${db}.sql\"" + execstr="su - $PGSQLUSER -c \"$PGSQLDUMP $db > '$backupdir/${db}.sql'\"" fi fi debug "$execstr" -- cgit v1.2.3 From 4996d8deb7fcf366f5c012ae919b1245db3d7b6a Mon Sep 17 00:00:00 2001 From: intrigeri Date: Fri, 25 Dec 2009 04:09:29 +0100 Subject: autotools: added the stat command to the automagically replaced ones ... hoping it will help supporting *BSD some day. --- ChangeLog | 3 +++ configure.in | 7 +++++++ src/Makefile.am | 1 + src/backupninja.in | 4 ++-- 4 files changed, 13 insertions(+), 2 deletions(-) (limited to 'ChangeLog') diff --git a/ChangeLog b/ChangeLog index 97d4353..d0f7011 100644 --- a/ChangeLog +++ b/ChangeLog @@ -41,6 +41,9 @@ version 0.9.7 -- UNRELEASED dup: . Fixed bandwidthlimit syntax error. Thanks to Ian Beckwith for the patch. + 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 diff --git a/configure.in b/configure.in index 26e95be..174399d 100644 --- a/configure.in +++ b/configure.in @@ -36,6 +36,13 @@ if test x$MKTEMPT = "xno"; then AC_MSG_ERROR([mktemp is required]) fi +AC_PATH_PROGS(STAT, stat, "no") +if test x$STAT = "xno"; then + AC_MSG_ERROR([stat is required]) +else + export STAT +fi + AC_CHECK_PROG(ac_cv_have_rpm, rpm, "yes", "no") if test "x$ac_cv_have_rpm" = "xyes"; then rpm --define '_topdir /tmp' > /dev/null 2>&1 diff --git a/src/Makefile.am b/src/Makefile.am index 3d5bdb8..5694e9a 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -11,6 +11,7 @@ edit = sed \ -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' \ diff --git a/src/backupninja.in b/src/backupninja.in index a158715..a991f58 100755 --- a/src/backupninja.in +++ b/src/backupninja.in @@ -143,14 +143,14 @@ function check_perms() { local perms local owners - perms=($(stat -L --format='%A' $file)) + 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)) + owners=($(@STAT@ -L --format='%g %G %u %U' $file)) local gid=${owners[0]} local group=${owners[1]} local owner=${owners[2]} -- cgit v1.2.3 From d4c5f73ad70bedbf54ee86dcbafead39f6318d55 Mon Sep 17 00:00:00 2001 From: intrigeri Date: Thu, 31 Dec 2009 17:05:47 +0100 Subject: dup.helper: do not propose to exclude /home/*/.gnupg twice anymore (Closes: #563044) --- ChangeLog | 4 ++++ handlers/dup.helper.in | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'ChangeLog') diff --git a/ChangeLog b/ChangeLog index d0f7011..5f6d51b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -41,6 +41,10 @@ version 0.9.7 -- UNRELEASED dup: . Fixed bandwidthlimit syntax error. Thanks to Ian Beckwith 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. diff --git a/handlers/dup.helper.in b/handlers/dup.helper.in index 3c08a2f..2fafb99 100644 --- a/handlers/dup.helper.in +++ b/handlers/dup.helper.in @@ -508,7 +508,7 @@ dup_wizard() { # Global variables whose '*' shall not be expanded set -o noglob dup_default_includes="/var/spool/cron/crontabs /var/backups /etc /root /home /usr/local/*bin /var/lib/dpkg/status*" - dup_default_excludes="/home/*/.gnupg /home/*/.gnupg /home/*/.local/share/Trash /home/*/.Trash /home/*/.thumbnails /home/*/.beagle /home/*/.aMule /home/*/gtk-gnutella-downloads" + dup_default_excludes="/home/*/.gnupg /home/*/.local/share/Trash /home/*/.Trash /home/*/.thumbnails /home/*/.beagle /home/*/.aMule /home/*/gtk-gnutella-downloads" set +o noglob dup_main_menu -- cgit v1.2.3 From 00e759430a1812bd5a2ca8dc5cc8e5046330c10b Mon Sep 17 00:00:00 2001 From: intrigeri Date: Tue, 5 Jan 2010 13:19:17 +0100 Subject: Added ChangeLog entry for 61eb6a74843ba000b4de58d3271c5cb545c891d0. --- ChangeLog | 2 ++ 1 file changed, 2 insertions(+) (limited to 'ChangeLog') diff --git a/ChangeLog b/ChangeLog index 5f6d51b..b6e05d0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -41,6 +41,8 @@ version 0.9.7 -- UNRELEASED 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) helper changes dup: . Do not propose to exclude /home/*/.gnupg twice anymore -- cgit v1.2.3 From 8fb9415609b3181d8522f42115508dd7a3643345 Mon Sep 17 00:00:00 2001 From: intrigeri Date: Tue, 5 Jan 2010 13:39:32 +0100 Subject: Adding optional report of infos sent by handlers in the email (closes #563734) Cherry-picked and re-indented patch 76792c8f45afa1fdaeb81c2af77499ca0b83ce64 from Olivier Berger. Conflicts: src/backupninja.in --- AUTHORS | 2 +- ChangeLog | 2 ++ etc/backupninja.conf.in | 4 ++++ src/backupninja.in | 7 ++++++- 4 files changed, 13 insertions(+), 2 deletions(-) (limited to 'ChangeLog') diff --git a/AUTHORS b/AUTHORS index 6309a1c..89b505f 100644 --- a/AUTHORS +++ b/AUTHORS @@ -30,4 +30,4 @@ Matthew Palmer -- halt loglevel feature dan@garthwaite.org -- reportspace bugfix Tuomas Jormola -- "when = manual" option Ian Beckwith -- dup bandwidthlimit fix -Olivier Berger -- dup debug output bugfix \ No newline at end of file +Olivier Berger -- dup debug output bugfix, reportinfo option \ No newline at end of file diff --git a/ChangeLog b/ChangeLog index b6e05d0..b71a9be 100644 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,8 @@ version 0.9.7 -- UNRELEASED . 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) lib changes easydialog: . Allow form fields input to grow up to 100 chars (Closes: #562249) diff --git a/etc/backupninja.conf.in b/etc/backupninja.conf.in index f7668a5..de1fbf3 100644 --- a/etc/backupninja.conf.in +++ b/etc/backupninja.conf.in @@ -21,6 +21,10 @@ reportemail = root # 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 diff --git a/src/backupninja.in b/src/backupninja.in index a991f58..f871e0c 100755 --- a/src/backupninja.in +++ b/src/backupninja.in @@ -335,8 +335,9 @@ function process_action() { _errors=`cat $bufferfile | grep "^Error: " | wc -l` _fatals=`cat $bufferfile | grep "^Fatal: " | wc -l` _halts=`cat $bufferfile | grep "^Halt: " | wc -l` + _infos=`cat $bufferfile | grep "^Info: " | wc -l` - ret=`grep "\(^Warning: \|^Error: \|^Fatal: \|Halt: \)" $bufferfile` + ret=`grep "\(^Info: \|^Warning: \|^Error: \|^Fatal: \|Halt: \)" $bufferfile` rm $bufferfile if [ $_halts != 0 ]; then msg "*halt* -- $file" @@ -356,6 +357,9 @@ function process_action() { warning "<<<< finished action $file: WARNING" else msg "success -- $file" + if [ $_infos != 0 -a "$reportinfo" == "yes" ]; then + errormsg="$errormsg\n== infos from $file ==\n\n$ret\n" + fi info "<<<< finished action $file: SUCCESS" fi @@ -456,6 +460,7 @@ getconf reportemail getconf reporthost getconf reportspace getconf reportsuccess yes +getconf reportinfo no getconf reportuser getconf reportwarning yes getconf loglevel 3 -- cgit v1.2.3 From b6fd3b231e7af0d387d99d376d1ba58442a68aba Mon Sep 17 00:00:00 2001 From: intrigeri Date: Tue, 5 Jan 2010 13:52:43 +0100 Subject: Added ChangeLog entry for previous commit. --- ChangeLog | 2 ++ 1 file changed, 2 insertions(+) (limited to 'ChangeLog') diff --git a/ChangeLog b/ChangeLog index b71a9be..586e3fd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -45,6 +45,8 @@ version 0.9.7 -- UNRELEASED 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) helper changes dup: . Do not propose to exclude /home/*/.gnupg twice anymore -- cgit v1.2.3 From 49bfd02bd3ee6eccc2eaa0a7c668c46b4a15af0a Mon Sep 17 00:00:00 2001 From: intrigeri Date: Tue, 5 Jan 2010 14:34:30 +0100 Subject: reportspace: skip non-directories and places that don't exist on the local filesystem (Closes: #536049) --- ChangeLog | 2 ++ src/backupninja.in | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'ChangeLog') diff --git a/ChangeLog b/ChangeLog index 586e3fd..130a544 100644 --- a/ChangeLog +++ b/ChangeLog @@ -7,6 +7,8 @@ version 0.9.7 -- UNRELEASED 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) lib changes easydialog: . Allow form fields input to grow up to 100 chars (Closes: #562249) diff --git a/src/backupninja.in b/src/backupninja.in index 34021b5..c3ec7ed 100755 --- a/src/backupninja.in +++ b/src/backupninja.in @@ -570,7 +570,7 @@ if [ $doit == 1 ]; then previous="" for i in $(ls "$configdirectory"); do backuploc=$(grep ^directory "$configdirectory"/"$i" | @AWK@ '{print $3}') - if [ "$backuploc" != "$previous" -a -n "$backuploc" ]; then + if [ "$backuploc" != "$previous" -a -n "$backuploc" -a -d "$backuploc" ]; then df -h "$backuploc" previous="$backuploc" fi -- cgit v1.2.3 From 47313bca65de105145f2168538b294a9bcc0e98d Mon Sep 17 00:00:00 2001 From: intrigeri Date: Fri, 8 Jan 2010 23:40:23 +0100 Subject: ldap,mysql,pgsql: use bash pipefail option so that failed dumps are reported as such This should fix Redmine bug #1340. This option makes pipelines return as status the value of the last (rightmost) command to exit with a non-zero status, or zero if all commands exit successfully. See bash(1) for details. E.g. this prevents the following from exiting with status 0 (!) if pg_dumpall fails: pg_dumpall | gzip --- ChangeLog | 6 ++++++ handlers/ldap.in | 2 +- handlers/mysql.in | 8 ++++---- handlers/pgsql.in | 8 ++++---- 4 files changed, 15 insertions(+), 9 deletions(-) (limited to 'ChangeLog') diff --git a/ChangeLog b/ChangeLog index 130a544..18ed157 100644 --- a/ChangeLog +++ b/ChangeLog @@ -15,6 +15,8 @@ version 0.9.7 -- UNRELEASED 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 @@ -32,10 +34,14 @@ version 0.9.7 -- UNRELEASED . 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. sys: . New luksheaders option (default=disabled) to backup the Luks header of every Luks device. diff --git a/handlers/ldap.in b/handlers/ldap.in index 853cefb..fda24d0 100644 --- a/handlers/ldap.in +++ b/handlers/ldap.in @@ -91,7 +91,7 @@ if [ "$ldif" == "yes" ]; then execstr="$execstr > $dumpdir/$dbsuffix.ldif" fi debug "$execstr" - output=`su root -c "$execstr" 2>&1` + output=`su root -c "set -o pipefail ; $execstr" 2>&1` code=$? if [ "$code" == "0" ]; then debug $output diff --git a/handlers/mysql.in b/handlers/mysql.in index f3230ad..3488c51 100644 --- a/handlers/mysql.in +++ b/handlers/mysql.in @@ -237,14 +237,14 @@ then then if [ $usevserver = yes ] then - debug 'echo show databases | $VSERVER $vsname exec su $user -c \"$MYSQL $defaultsfile\" | grep -v Database' - databases=`echo 'show databases' | $VSERVER $vsname exec su $user -c "$MYSQL $defaultsfile" | grep -v Database` + debug 'set -o pipefail ; echo show databases | $VSERVER $vsname exec su $user -c \"$MYSQL $defaultsfile\" | grep -v Database' + databases=`set -o pipefail ; echo 'show databases' | $VSERVER $vsname exec su $user -c "$MYSQL $defaultsfile" | grep -v Database` if [ $? -ne 0 ] then fatal "Authentication problem, maybe user/password is wrong or mysqld is not running?" fi else - databases=$(su $user -c "$MYSQL $defaultsfile -N -B -e 'show databases'" | sed 's/|//g;/\+----/d') + databases=$(set -o pipefail ; su $user -c "$MYSQL $defaultsfile -N -B -e 'show databases'" | sed 's/|//g;/\+----/d') if [ $? -ne 0 ] then fatal "Authentication problem, maybe user/password is wrong or mysqld is not running?" @@ -298,7 +298,7 @@ then debug "su $user -c \"$execstr\"" if [ ! $test ] then - output=`su $user -c "$execstr" 2>&1` + output=`su $user -c "set -o pipefail ; $execstr" 2>&1` code=$? if [ "$code" == "0" ] then diff --git a/handlers/pgsql.in b/handlers/pgsql.in index d7839fb..77a73fe 100644 --- a/handlers/pgsql.in +++ b/handlers/pgsql.in @@ -75,13 +75,13 @@ chmod 700 $vroot$backupdir if [ "$databases" == "all" ]; then if [ $usevserver = yes ]; then if [ "$compress" == "yes" ]; then - execstr="$VSERVER $vsname exec su - $PGSQLUSER -c \"$PGSQLDUMPALL | $GZIP --rsyncable > '$backupdir/${vsname}.sql.gz'\"" + execstr="$VSERVER $vsname exec su - $PGSQLUSER -c \"set -o pipefail ; $PGSQLDUMPALL | $GZIP --rsyncable > '$backupdir/${vsname}.sql.gz'\"" else execstr="$VSERVER $vsname exec su - $PGSQLUSER -c \"$PGSQLDUMPALL > '$backupdir/${vsname}.sql'\"" fi else if [ "$compress" == "yes" ]; then - execstr="su - $PGSQLUSER -c \"$PGSQLDUMPALL | $GZIP --rsyncable > '$backupdir/${localhost}-all.sql.gz'\"" + execstr="su - $PGSQLUSER -c \"set -o pipefail ; $PGSQLDUMPALL | $GZIP --rsyncable > '$backupdir/${localhost}-all.sql.gz'\"" else execstr="su - $PGSQLUSER -c \"$PGSQLDUMPALL > '$backupdir/${localhost}-all.sql'\"" fi @@ -104,13 +104,13 @@ else for db in $databases; do if [ $usevserver = yes ]; then if [ "$compress" == "yes" ]; then - execstr="$VSERVER $vsname exec su - $PGSQLUSER -c \"$PGSQLDUMP $db | $GZIP --rsyncable > '$backupdir/${db}.sql.gz'\"" + execstr="$VSERVER $vsname exec su - $PGSQLUSER -c \"set -o pipefail ; $PGSQLDUMP $db | $GZIP --rsyncable > '$backupdir/${db}.sql.gz'\"" else execstr="$VSERVER $vsname exec su - $PGSQLUSER -c \"$PGSQLDUMP $db | > '$backupdir/${db}.sql'\"" fi else if [ "$compress" == "yes" ]; then - execstr="su - $PGSQLUSER -c \"$PGSQLDUMP $db | $GZIP --rsyncable > '$backupdir/${db}.sql.gz'\"" + execstr="su - $PGSQLUSER -c \"set -o pipefail ; $PGSQLDUMP $db | $GZIP --rsyncable > '$backupdir/${db}.sql.gz'\"" else execstr="su - $PGSQLUSER -c \"$PGSQLDUMP $db > '$backupdir/${db}.sql'\"" fi -- cgit v1.2.3 From 4e0519e390137b18b545f0ad256d03941cdd7bac Mon Sep 17 00:00:00 2001 From: intrigeri Date: Sat, 9 Jan 2010 00:44:43 +0100 Subject: rdiff,dup: fix include/exclude paths with spaces (Closes: #398435) This also fixes Redmine bug #1021. --- ChangeLog | 3 +++ handlers/dup.in | 9 +++++++++ handlers/rdiff.in | 9 +++++++++ 3 files changed, 21 insertions(+) (limited to 'ChangeLog') diff --git a/ChangeLog b/ChangeLog index 18ed157..fb6b622 100644 --- a/ChangeLog +++ b/ChangeLog @@ -42,6 +42,8 @@ version 0.9.7 -- UNRELEASED 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) sys: . New luksheaders option (default=disabled) to backup the Luks header of every Luks device. @@ -55,6 +57,7 @@ version 0.9.7 -- UNRELEASED 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 helper changes dup: . Do not propose to exclude /home/*/.gnupg twice anymore diff --git a/handlers/dup.in b/handlers/dup.in index 6e0f698..2f55b9c 100644 --- a/handlers/dup.in +++ b/handlers/dup.in @@ -189,26 +189,35 @@ fi set -o noglob # excludes +SAVEIFS=$IFS +IFS=$(echo -en "\n\b") for i in $exclude; do str="${i//__star__/*}" execstr_source="${execstr_source} --exclude '$str'" done +IFS=$SAVEIFS # includes +SAVEIFS=$IFS +IFS=$(echo -en "\n\b") for i in $include; do [ "$i" != "/" ] || fatal "Sorry, you cannot use 'include = /'" str="${i//__star__/*}" execstr_source="${execstr_source} --include '$str'" done +IFS=$SAVEIFS # vsincludes if [ $usevserver = yes ]; then for vserver in $vsnames; do + SAVEIFS=$IFS + IFS=$(echo -en "\n\b") for vi in $vsinclude; do str="${vi//__star__/*}" str="$VROOTDIR/$vserver$str" execstr_source="${execstr_source} --include '$str'" done + IFS=$SAVEIFS done fi diff --git a/handlers/rdiff.in b/handlers/rdiff.in index 45d5096..98a53a3 100644 --- a/handlers/rdiff.in +++ b/handlers/rdiff.in @@ -209,20 +209,28 @@ symlinks_warning="Maybe you have mixed symlinks and '*' in this statement, which # TODO: order the includes and excludes # excludes +SAVEIFS=$IFS +IFS=$(echo -en "\n\b") for i in $exclude; do str="${i//__star__/*}" execstr="${execstr}--exclude '$str' " done +IFS=$SAVEIFS # includes +SAVEIFS=$IFS +IFS=$(echo -en "\n\b") for i in $include; do [ "$i" != "/" ] || fatal "Sorry, you cannot use 'include = /'" str="${i//__star__/*}" execstr="${execstr}--include '$str' " done +IFS=$SAVEIFS # vsinclude if [ $usevserver = yes ]; then for vserver in $vsnames; do + SAVEIFS=$IFS + IFS=$(echo -en "\n\b") for vi in $vsinclude; do str="${vi//__star__/*}" str="$VROOTDIR/$vserver$str" @@ -232,6 +240,7 @@ if [ $usevserver = yes ]; then warning "vsinclude statement '${vi//__star__/*}' will be ignored for VServer $vserver. $symlinks_warning" fi done + IFS=$SAVEIFS done fi -- cgit v1.2.3 From 0fbd8744f5c10649b7239c3199dae229a30e10a9 Mon Sep 17 00:00:00 2001 From: intrigeri Date: Sat, 9 Jan 2010 01:19:21 +0100 Subject: set BACKUPNINJA_DEBUG when invoked with -d (Closes: #537266) --- ChangeLog | 1 + src/backupninja.in | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'ChangeLog') diff --git a/ChangeLog b/ChangeLog index fb6b622..12c1436 100644 --- a/ChangeLog +++ b/ChangeLog @@ -9,6 +9,7 @@ version 0.9.7 -- UNRELEASED "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) diff --git a/src/backupninja.in b/src/backupninja.in index c3ec7ed..e8a820f 100755 --- a/src/backupninja.in +++ b/src/backupninja.in @@ -381,7 +381,7 @@ loglevel=3 while [ $# -ge 1 ]; do case $1 in -h|--help) usage;; - -d|--debug) debug=1;; + -d|--debug) debug=1; export BACKUPNINJA_DEBUG=yes;; -t|--test) test=1;debug=1;; -n|--now) processnow=1;; -f|--conffile) -- cgit v1.2.3 From 64c4d190a3ab6b4fa60b10208b32f3b270a72482 Mon Sep 17 00:00:00 2001 From: intrigeri Date: Sat, 9 Jan 2010 23:14:17 +0100 Subject: dup: support backups to Amazon S3 buckets Thanks to stefan for the patch. This fixes Redmine bug #658. --- AUTHORS | 3 ++- ChangeLog | 1 + README | 10 ++++++++++ examples/example.dup | 12 ++++++++++++ handlers/dup.helper.in | 6 ++++++ handlers/dup.in | 11 +++++++++++ 6 files changed, 42 insertions(+), 1 deletion(-) (limited to 'ChangeLog') diff --git a/AUTHORS b/AUTHORS index 89b505f..c8686eb 100644 --- a/AUTHORS +++ b/AUTHORS @@ -30,4 +30,5 @@ Matthew Palmer -- halt loglevel feature dan@garthwaite.org -- reportspace bugfix Tuomas Jormola -- "when = manual" option Ian Beckwith -- dup bandwidthlimit fix -Olivier Berger -- dup debug output bugfix, reportinfo option \ No newline at end of file +Olivier Berger -- dup debug output bugfix, reportinfo option +stefan -- dup support for Amazon S3 buckets diff --git a/ChangeLog b/ChangeLog index 12c1436..f4009d7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -59,6 +59,7 @@ version 0.9.7 -- UNRELEASED . 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 diff --git a/README b/README index 03d96fe..04eda2f 100644 --- a/README +++ b/README @@ -182,6 +182,16 @@ blank by hitting return. The included helper program "ninjahelper" will walk you through creating an rdiff-backup configuration, and will set up the ssh keys for you. + +Amazon Simple Storage Service (S3) +================================== + +Duplicity can store backups on Amazon S3 buckets, taking care of encryption. +Since it performs incremental backups it minimizes the number of request per +operation therefore reducing the costs. The boto Python interface to Amazon +Web Services is needed to use duplicity with S3 (Debian package: python-boto). + + INSTALLATION ============ diff --git a/examples/example.dup b/examples/example.dup index 2b59fe5..ea4d66e 100644 --- a/examples/example.dup +++ b/examples/example.dup @@ -8,6 +8,8 @@ ## passed directly to duplicity, e.g. to increase verbosity set this to: ## options = --verbosity 8 +## when using the Amazon S3 backend to create buckets in Europe: +## options = --s3-european-buckets --s3-use-new-style ## ## Default: # options = @@ -158,11 +160,21 @@ exclude = /home/*/.gnupg ## examples include: ## desturl = file:///usr/local/backup ## desturl = rsync://user@other.host//var/backup/bla +## desturl = s3+http:// ## the default value of this configuration option is not set: ## ## Default: # desturl = +## Amazon Web Services Access Key ID and Secret Access Key, needed for backups +## to S3 buckets. +## awsaccesskeyid = YOUR_AWS_ACCESS_KEY_ID +## awssecretaccesskey = YOUR_AWS_SECRET_KEY +## +## Default: +# awsaccesskeyid = +# awssecretaccesskey = + ## bandwith limit, in kbit/s ; default is 0, i.e. no limit an example ## setting would be: ## bandwidthlimit = 128 diff --git a/handlers/dup.helper.in b/handlers/dup.helper.in index 2fafb99..ae48e4c 100644 --- a/handlers/dup.helper.in +++ b/handlers/dup.helper.in @@ -403,6 +403,12 @@ keep = $dup_keep # bandwithlimit. For details, see duplicity manpage, section "URL FORMAT". #desturl = file:///usr/local/backup #desturl = rsync://user@other.host//var/backup/bla +#desturl = s3+http://your_bucket + +# Amazon Web Services Access Key ID and Secret Access Key, needed for backups +# to S3 buckets. +#awsaccesskeyid = YOUR_AWS_ACCESS_KEY_ID +#awssecretaccesskey = YOUR_AWS_SECRET_KEY # bandwith limit, in kbit/s ; default is 0, i.e. no limit #bandwidthlimit = 128 diff --git a/handlers/dup.in b/handlers/dup.in index 2f55b9c..ffae48c 100644 --- a/handlers/dup.in +++ b/handlers/dup.in @@ -26,6 +26,8 @@ setsection dest getconf incremental yes getconf keep 60 getconf desturl +getconf awsaccesskeyid +getconf awssecretaccesskey getconf sshoptions getconf bandwidthlimit 0 getconf desthost @@ -38,6 +40,9 @@ destdir=${destdir%/} [ -n "$desturl" -o -n "$destdir" ] || fatal "The destination directory (destdir) must be set when desturl is not used." [ -n "$include" -o -n "$vsinclude" ] || fatal "No source includes specified" [ -n "$password" ] || fatal "The password option must be set." +if [ "`echo $desturl | @AWK@ -F ':' '{print $1}'`" == "s3+http" ]; then + [ -n "$awsaccesskeyid" -a -n "$awssecretaccesskey" ] || fatal "AWS access keys must be set for S3 backups." +fi ### VServers # If vservers are configured, check that the ones listed in $vsnames do exist. @@ -227,6 +232,12 @@ set +o noglob execstr_source=${execstr_source//\\*/\\\\\\*} +### If desturl is an S3 URL export the AWS environment variables +if [ "`echo $desturl | @AWK@ -F ':' '{print $1}'`" == "s3+http" ]; then + export AWS_ACCESS_KEY_ID="$awsaccesskeyid" + export AWS_SECRET_ACCESS_KEY="$awssecretaccesskey" +fi + ### Cleanup commands (duplicity >= 0.4.4) # cleanup -- cgit v1.2.3 From 46eccf2fd0c894790405b2e3aae8dfb99f5a5d98 Mon Sep 17 00:00:00 2001 From: intrigeri Date: Sat, 9 Jan 2010 23:25:03 +0100 Subject: rdiff: fix confusing error if rdiff-backup cannot be found on remote server. Thanks to maniacmartin for the patch on which this one is based. This closes Redmine bug #1209. --- AUTHORS | 1 + ChangeLog | 1 + handlers/rdiff.in | 8 +++++++- 3 files changed, 9 insertions(+), 1 deletion(-) (limited to 'ChangeLog') diff --git a/AUTHORS b/AUTHORS index c8686eb..07d55c0 100644 --- a/AUTHORS +++ b/AUTHORS @@ -32,3 +32,4 @@ Tuomas Jormola -- "when = manual" option Ian Beckwith -- dup bandwidthlimit fix Olivier Berger -- dup debug output bugfix, reportinfo option stefan -- dup support for Amazon S3 buckets +maniacmartin -- rdiff confusing error message fix diff --git a/ChangeLog b/ChangeLog index f4009d7..b1e140b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -45,6 +45,7 @@ version 0.9.7 -- UNRELEASED reported as such. rdiff: . Fix include/exclude paths with spaces (Closes: #398435) + . Fix confusing error if rdiff-backup cannot be found on remote server. sys: . New luksheaders option (default=disabled) to backup the Luks header of every Luks device. diff --git a/handlers/rdiff.in b/handlers/rdiff.in index 98a53a3..60386fa 100644 --- a/handlers/rdiff.in +++ b/handlers/rdiff.in @@ -31,6 +31,7 @@ function get_version() { # given no arguments, returns the local version. # given a user and host, returns the remote version. # if user or host is missing, returns the local version. + local version if [ "$#" -lt 2 ]; then debug "$RDIFFBACKUP -V" echo `$RDIFFBACKUP -V` @@ -38,7 +39,12 @@ function get_version() { local user=$1 local host=$2 debug "ssh $sshoptions $host -l $user '$RDIFFBACKUP -V'" - echo `ssh $sshoptions $host -l $user "$RDIFFBACKUP -V | grep rdiff-backup"` + version=`ssh $sshoptions $host -l $user "$RDIFFBACKUP -V"` + if [ $? = 127 ]; then + fatal "Unable to execute rdiff-backup on remote server. It probably isn't installed" + else + echo "$version" | grep rdiff-backup + fi fi } -- cgit v1.2.3