From 7dce2f1138796cfb78c22a402b6039bdf76d4220 Mon Sep 17 00:00:00 2001 From: intrigeri Date: Sat, 6 Mar 2010 15:27:34 +0100 Subject: sys: only run mdadm if RAID devices actually exist (Closes: #572450) --- ChangeLog | 5 +++++ handlers/sys.in | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 4be58ba..2fbe7ed 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +version 0.9.8 -- UNRELEASED + handler changes + sys: + . Only run mdadm if RAID devices actually exist (Closes: #572450) + version 0.9.7 -- January 27, 2010 backupninja changes . fix bug in reportspace, thanks Dan Garthwaite diff --git a/handlers/sys.in b/handlers/sys.in index 69751ed..a92663e 100755 --- a/handlers/sys.in +++ b/handlers/sys.in @@ -462,7 +462,9 @@ STATUS="Collecting Software RAID information (/etc/mdadm.conf)" catiffile "/etc/mdadm.conf" STATUS="Collecting Software RAID information (/sbin/mdadm -Q)" -catifexec "/sbin/mdadm" "-Q" "--detail" '/dev/md?*' +if ls /dev/md?* >/dev/null 2>&1; then + catifexec "/sbin/mdadm" "-Q" "--detail" '/dev/md?*' +fi STATUS="Collecting Automount information (auto.master)" catiffile "/etc/auto.master" -- cgit v1.2.3 From 1cd91839c360931fc97bdef0b31d7887218d00ed Mon Sep 17 00:00:00 2001 From: intrigeri Date: Sat, 6 Mar 2010 19:25:27 +0100 Subject: dup: use duplicity's --extra-clean option when necessary This is necessary to get rid of unnecessary old cache files when cleaning up, when using duplicity >=0.6.01 that depends on local caching. Closes: #572721 --- ChangeLog | 4 ++++ handlers/dup.in | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/ChangeLog b/ChangeLog index 2fbe7ed..7b8d383 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,10 @@ version 0.9.8 -- UNRELEASED handler changes sys: . Only run mdadm if RAID devices actually exist (Closes: #572450) + dup: + . 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) version 0.9.7 -- January 27, 2010 backupninja changes diff --git a/handlers/dup.in b/handlers/dup.in index ffae48c..c8dfcba 100644 --- a/handlers/dup.in +++ b/handlers/dup.in @@ -165,6 +165,11 @@ if [ "$incremental" == "no" ]; then fi fi +### Cleanup options +if [ "$duplicity_major" -ge 0 -a "$duplicity_minor" -ge 6 -a "$duplicity_sub" -ge 1 ]; then + execstr_options="${execstr_options} --extra-clean" +fi + ### Temporary directory precmd= if [ -n "$tmpdir" ]; then -- cgit v1.2.3 From 582b7521cba4391845c167037cc1d362c7e76bd3 Mon Sep 17 00:00:00 2001 From: intrigeri Date: Sat, 24 Apr 2010 19:56:54 +0200 Subject: dup: ignore anything but digits and "." when comparing versions (Closes: #578987) I'd love to use "dpkg --compare-versions" but we don't want backupninja to be Debian-specific. Any similar tool? Signed-off-by: intrigeri --- ChangeLog | 2 ++ handlers/dup.in | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7b8d383..f944201 100644 --- a/ChangeLog +++ b/ChangeLog @@ -6,6 +6,8 @@ version 0.9.8 -- UNRELEASED . 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) + . dup: ignore anything but digits and "." when comparing versions + (Closes: #578987) version 0.9.7 -- January 27, 2010 backupninja changes diff --git a/handlers/dup.in b/handlers/dup.in index c8dfcba..c893017 100644 --- a/handlers/dup.in +++ b/handlers/dup.in @@ -95,8 +95,8 @@ else execstr_serverpart="scp://$destuser@$desthost/$destdir" fi -### duplicity version -duplicity_version="`duplicity --version | @AWK@ '{print $2}'`" +### duplicity version (ignore anything else than 0-9 and ".") +duplicity_version="`duplicity --version | @AWK@ '{print $2}' | @SED@ 's/[^.[:digit:]]//g'`" duplicity_major="`echo $duplicity_version | @AWK@ -F '.' '{print $1}'`" duplicity_minor="`echo $duplicity_version | @AWK@ -F '.' '{print $2}'`" duplicity_sub="`echo $duplicity_version | @AWK@ -F '.' '{print $3}'`" -- cgit v1.2.3 From 4f4ee9b0d9fe404b9a126c5eb05d81da695b7cda Mon Sep 17 00:00:00 2001 From: olivier Date: Sun, 2 May 2010 12:05:10 +0200 Subject: Add full-if-older-than with half the keep duration --- handlers/dup.in | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/handlers/dup.in b/handlers/dup.in index c893017..0b14ef9 100644 --- a/handlers/dup.in +++ b/handlers/dup.in @@ -163,6 +163,16 @@ if [ "$incremental" == "no" ]; then else execstr_command="full" fi +else + if [ "$keep" != "yes" ]; then + fullifolderthan="30D" + if [ "`echo $keep | tr -d 0-9`" == "" ]; then + #let "fullifolderthan = keep / 2" + fullifolderthan=$(($keep / 2)) + fullifolderthan="${fullifolderthan}D" + fi + execstr_options="${execstr_options} --full-if-older-than $fullifolderthan" + fi fi ### Cleanup options -- cgit v1.2.3 From abf7a4bb651c5ec85306fca96a572dfc8a424edb Mon Sep 17 00:00:00 2001 From: Olivier Berger Date: Sun, 2 May 2010 17:40:50 +0200 Subject: Implement Debian #535996 to use --full-if-older-than --- handlers/dup.helper.in | 15 +++++++++++++-- handlers/dup.in | 14 +++++++------- 2 files changed, 20 insertions(+), 9 deletions(-) diff --git a/handlers/dup.helper.in b/handlers/dup.helper.in index 8b344dc..4ac33d7 100644 --- a/handlers/dup.helper.in +++ b/handlers/dup.helper.in @@ -123,6 +123,7 @@ do_dup_dest() { formItem "destdir" "$dup_destdir" formItem "keep" "$dup_keep" formItem "incremental" "$dup_incremental" + formItem "increments" "$dup_increments" formItem "bandwidthlimit" "$dup_bandwidth" formItem "sshoptions" "$dup_sshoptions" formDisplay @@ -139,8 +140,9 @@ do_dup_dest() { dup_destdir=${thereply[2]} dup_keep=${thereply[3]} dup_incremental=${thereply[4]} - dup_bandwidth=${thereply[5]} - dup_sshoptions=${thereply[6]} + dup_increments=${thereply[5]} + dup_bandwidth=${thereply[6]} + dup_sshoptions=${thereply[7]} done set +o noglob @@ -406,6 +408,14 @@ EOF # if incremental = no, perform a full backup in order to start a new backup set incremental = $dup_incremental +# how many days of incremental backups before doing a full backup again ; default is 30 days. +# (you can also use the time format of duplicity) +# if 'increments = keep' is set : do not start another full backup, +# but keep doing incremental backups +#increments = 30 +#increments = keep +increments = $dup_increments + # how many days of data to keep ; default is 60 days. # (you can also use the time format of duplicity) # 'keep = yes' means : do not delete old data, the remote host will take care of this @@ -510,6 +520,7 @@ dup_wizard() { dup_excludes= dup_vsincludes= dup_incremental=yes + dup_increments=30 dup_keep=60 dup_bandwidth= dup_sshoptions= diff --git a/handlers/dup.in b/handlers/dup.in index 0b14ef9..16b5af2 100644 --- a/handlers/dup.in +++ b/handlers/dup.in @@ -24,6 +24,7 @@ getconf exclude setsection dest getconf incremental yes +getconf increments 30 getconf keep 60 getconf desturl getconf awsaccesskeyid @@ -164,14 +165,13 @@ if [ "$incremental" == "no" ]; then execstr_command="full" fi else - if [ "$keep" != "yes" ]; then - fullifolderthan="30D" - if [ "`echo $keep | tr -d 0-9`" == "" ]; then - #let "fullifolderthan = keep / 2" - fullifolderthan=$(($keep / 2)) - fullifolderthan="${fullifolderthan}D" + # we're in incremental mode + if [ "$increments" != "keep" ]; then + # if we don't want to keep every increments + if [ "`echo $increments | tr -d 0-9`" == "" ]; then + increments="${increments}D" fi - execstr_options="${execstr_options} --full-if-older-than $fullifolderthan" + execstr_options="${execstr_options} --full-if-older-than $increments" fi fi -- cgit v1.2.3 From e0981ba3f0982c15a66395158954c4b2528834b3 Mon Sep 17 00:00:00 2001 From: intrigeri Date: Thu, 6 May 2010 18:49:18 +0200 Subject: Rephrase, reformat and sync example dup configuration. --- examples/example.dup | 8 ++++++++ handlers/dup.helper.in | 8 ++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/examples/example.dup b/examples/example.dup index ea4d66e..53039f5 100644 --- a/examples/example.dup +++ b/examples/example.dup @@ -147,6 +147,14 @@ exclude = /home/*/.gnupg ## Default: # incremental = yes +## how many days of incremental backups before doing a full backup again ; +## default is 30 days (one can also use the time format of duplicity). +## if increments = keep, never automatically perform a new full backup ; +## only perform incremental backups. +## +## Default: +# increments = 30 + ## how many days of data to keep ; default is 60 days. ## (you can also use the time format of duplicity) ## 'keep = yes' means : do not delete old data, the remote host will take care of this diff --git a/handlers/dup.helper.in b/handlers/dup.helper.in index 4ac33d7..47f4469 100644 --- a/handlers/dup.helper.in +++ b/handlers/dup.helper.in @@ -408,10 +408,10 @@ EOF # if incremental = no, perform a full backup in order to start a new backup set incremental = $dup_incremental -# how many days of incremental backups before doing a full backup again ; default is 30 days. -# (you can also use the time format of duplicity) -# if 'increments = keep' is set : do not start another full backup, -# but keep doing incremental backups +# how many days of incremental backups before doing a full backup again ; +# default is 30 days (one can also use the time format of duplicity). +# if increments = keep, never automatically perform a new full backup ; +# only perform incremental backups. #increments = 30 #increments = keep increments = $dup_increments -- cgit v1.2.3 From 25f50151e77805e9c010d7f4244e38089cfdd0a7 Mon Sep 17 00:00:00 2001 From: intrigeri Date: Thu, 6 May 2010 18:56:56 +0200 Subject: Updated ChangeLog and AUTHORS. --- AUTHORS | 2 +- ChangeLog | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/AUTHORS b/AUTHORS index be4e7e6..92a2184 100644 --- a/AUTHORS +++ b/AUTHORS @@ -30,7 +30,7 @@ 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 +Olivier Berger -- much work on the dup handler stefan -- dup support for Amazon S3 buckets maniacmartin -- rdiff confusing error message fix Chris Nolan -- maildir subdirectory expansion diff --git a/ChangeLog b/ChangeLog index f944201..f09d1d4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,9 @@ version 0.9.8 -- UNRELEASED 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) -- cgit v1.2.3 From 33365d09530426b15fa7395c77fab4d163d8e684 Mon Sep 17 00:00:00 2001 From: intrigeri Date: Thu, 6 May 2010 19:27:18 +0200 Subject: dup: use --archive-dir /var/backups/duplicity unless the user has specified it (Closes: 580213) --- ChangeLog | 3 +++ handlers/dup.in | 9 +++++++++ 2 files changed, 12 insertions(+) diff --git a/ChangeLog b/ChangeLog index f09d1d4..db140ba 100644 --- a/ChangeLog +++ b/ChangeLog @@ -11,6 +11,9 @@ version 0.9.8 -- UNRELEASED 0.6.01 or newer, that depends on local caching (Closes: #572721) . dup: ignore anything but digits and "." when comparing versions (Closes: #578987) + . Put archive directory (cache) into /var/backups/duplicity rather + than the default /root/.cache/duplicity, unless the user + has specified it (Closes: 580213) version 0.9.7 -- January 27, 2010 backupninja changes diff --git a/handlers/dup.in b/handlers/dup.in index 16b5af2..b881b0a 100644 --- a/handlers/dup.in +++ b/handlers/dup.in @@ -193,6 +193,15 @@ if [ -n "$tmpdir" ]; then precmd="${precmd}TMPDIR=$tmpdir " fi +### Archive directory +# duplicity >= 0.6.01 enables the archive_dir by default, let's put it into /var/backups +# unless the user has specified it. +if [ "$duplicity_major" -ge 0 -a "$duplicity_minor" -ge 6 -a "$duplicity_sub" -ge 1 ]; then + if echo "${options}" | grep -qv -- "--archive-dir" ; then + execstr_options="${execstr_options} --archive-dir /var/backups/duplicity" + fi +fi + ### Cleanup old backup sets (or not) if [ "$keep" != "yes" ]; then if [ "`echo $keep | tr -d 0-9`" == "" ]; then -- cgit v1.2.3 From acd5a7e2e4f8d951ada9b4e485f29b3a9a425c00 Mon Sep 17 00:00:00 2001 From: intrigeri Date: Thu, 6 May 2010 19:28:02 +0200 Subject: Fix ChangeLog entry. --- ChangeLog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index db140ba..3dfbed8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -9,7 +9,7 @@ version 0.9.8 -- UNRELEASED . 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) - . dup: ignore anything but digits and "." when comparing versions + . Ignore anything but digits and "." when comparing versions (Closes: #578987) . Put archive directory (cache) into /var/backups/duplicity rather than the default /root/.cache/duplicity, unless the user -- cgit v1.2.3 From 6cf9c8988b137e42f0d29ade910d2a4f50372798 Mon Sep 17 00:00:00 2001 From: intrigeri Date: Thu, 6 May 2010 19:37:33 +0200 Subject: Added NEWS item about the new duplicity archive directory location. --- NEWS | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/NEWS b/NEWS index ef8592e..50739f4 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,19 @@ +backupninja (0.9.8-1) UNRELEASED + + * duplicity 0.6.01 and later defaults to using an archive (cache) + directory, which was previously opt-in. Starting with backupninja + 0.9.8, the backupninja duplicity handler puts this cache into + /var/backups/duplicity unless specified by the user with the "options" + setting the *.dup job. + When backups have been performed with backupninja older than 0.9.8 in + conjunction with duplicity 0.6.01 or later, e.g. when using Sid or + Squeeze at certain times of the Squeeze release cycle, cache files + were probably saved into /root/.cache/duplicity; one may want to + delete these files, or rather save bandwidth and just move the cache + directory to the new location: + + mv /root/.cache/duplicity /var/backups/ + backupninja (0.9.7-1) UNRELEASED * mysql: output filenames to support shell meta-characters in -- cgit v1.2.3 From 219a6eb958a6f8cc9dce34f9f87a95c02ef0c322 Mon Sep 17 00:00:00 2001 From: intrigeri Date: Thu, 6 May 2010 19:47:54 +0200 Subject: Better example.dup documentation. Thanks, Alster! --- ChangeLog | 1 + examples/example.dup | 24 +++++++++++++++--------- handlers/dup.helper.in | 17 +++++++++++++---- 3 files changed, 29 insertions(+), 13 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3dfbed8..cfa0959 100644 --- a/ChangeLog +++ b/ChangeLog @@ -14,6 +14,7 @@ version 0.9.8 -- UNRELEASED . Put archive directory (cache) into /var/backups/duplicity rather than the default /root/.cache/duplicity, unless the user has specified it (Closes: 580213) + . Better example.dup documentation. Thanks, Alster! version 0.9.7 -- January 27, 2010 backupninja changes diff --git a/examples/example.dup b/examples/example.dup index 53039f5..2c0c41d 100644 --- a/examples/example.dup +++ b/examples/example.dup @@ -19,7 +19,8 @@ ## Default: # nicelevel = 0 -## test the connection? set to no to skip the test if the remote host is alive +## test the connection? set to no to skip the test if the remote host is alive. +## if 'desturl' is set below, 'testconnect' must be set to 'no' for now. ## ## Default: # testconnect = yes @@ -169,6 +170,7 @@ exclude = /home/*/.gnupg ## desturl = file:///usr/local/backup ## desturl = rsync://user@other.host//var/backup/bla ## desturl = s3+http:// +## desturl = ftp://myftpuser[:myftppassword]@ftp.example.org/remote/ftp/path ## the default value of this configuration option is not set: ## ## Default: @@ -183,8 +185,9 @@ exclude = /home/*/.gnupg # awsaccesskeyid = # awssecretaccesskey = -## bandwith limit, in kbit/s ; default is 0, i.e. no limit an example -## setting would be: +## bandwith limit, in kbit/s ; default is 0, i.e. no limit +## if using 'desturl' above, 'bandwidthlimit' must not be set +## an example setting of 128 kbps would be: ## bandwidthlimit = 128 ## ## Default: @@ -199,14 +202,18 @@ exclude = /home/*/.gnupg ## Default: # sshoptions = -## put the backups under this directory, this must be set! +## put the backups under this destination directory +## if using 'desturl' above, this must not be set +## in all other cases, this must be set! ## an example setting would be: ## destdir = /backups ## ## Default: # destdir = -## the machine which will receive the backups, this must be set! +## the machine which will receive the backups +## if using 'desturl' above, this must not be set +## in all other cases, this must be set! ## an example setting would be: ## desthost = backuphost ## @@ -214,12 +221,11 @@ exclude = /home/*/.gnupg # desthost = ## make the files owned by this user -## note: you must be able to ssh backupuser@backhost -## without specifying a password (if type = remote). +## if using 'desturl' above, this must not be set +## note: if using an SSH based transport and 'type' is set to 'remote', you must +## be able to 'ssh backupuser@backuphost' without specifying a password. ## an example setting would be: ## destuser = backupuser ## ## Default: # destuser = - - diff --git a/handlers/dup.helper.in b/handlers/dup.helper.in index 47f4469..a47064d 100644 --- a/handlers/dup.helper.in +++ b/handlers/dup.helper.in @@ -280,7 +280,8 @@ options = $dup_options # default is 0, but set to 19 if you want to lower the priority. nicelevel = $dup_nicelevel -# default is yes. set to no to skip the test if the remote host is alive +# default is yes. set to no to skip the test if the remote host is alive. +# if 'desturl' is set below, 'testconnect' must be set to 'no' for now. testconnect = $dup_testconnect ###################################################### @@ -429,6 +430,7 @@ keep = $dup_keep #desturl = file:///usr/local/backup #desturl = rsync://user@other.host//var/backup/bla #desturl = s3+http://your_bucket +#desturl = ftp://myftpuser[:myftppassword]@ftp.example.org/remote/ftp/path # Amazon Web Services Access Key ID and Secret Access Key, needed for backups # to S3 buckets. @@ -436,6 +438,8 @@ keep = $dup_keep #awssecretaccesskey = YOUR_AWS_SECRET_KEY # bandwith limit, in kbit/s ; default is 0, i.e. no limit +# if using 'desturl' above, 'bandwidthlimit' must not be set +# an example setting of 128 kbps would be: #bandwidthlimit = 128 bandwidthlimit = $dup_bandwidth @@ -445,15 +449,20 @@ bandwidthlimit = $dup_bandwidth #sshoptions = -o IdentityFile=/root/.ssh/id_dsa_duplicity sshoptions = $dup_sshoptions -# put the backups under this directory +# put the backups under this destination directory +# if using 'desturl' above, this must not be set +# in all other cases, this must be set! destdir = $dup_destdir # the machine which will receive the backups +# if using 'desturl' above, this must not be set +# in all other cases, this must be set! desthost = $dup_desthost # make the files owned by this user -# note: you must be able to ssh backupuser@backhost -# without specifying a password (if type = remote). +# if using 'desturl' above, this must not be set +# note: if using an SSH based transport and 'type' is set to 'remote', you must +# be able to 'ssh backupuser@backuphost' without specifying a password. destuser = $dup_destuser EOF -- cgit v1.2.3 From 99434c8b07f29fd45d1db55b30b5820a47d5a1ab Mon Sep 17 00:00:00 2001 From: intrigeri Date: Thu, 6 May 2010 20:05:20 +0200 Subject: Added ftp_password option. This is the only way to securely transmit the FTP password from backupninja to duplicity. --- ChangeLog | 2 ++ examples/example.dup | 7 ++++++- handlers/dup.helper.in | 5 ++++- handlers/dup.in | 7 +++++++ 4 files changed, 19 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index cfa0959..26cac5c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -15,6 +15,8 @@ version 0.9.8 -- UNRELEASED 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. version 0.9.7 -- January 27, 2010 backupninja changes diff --git a/examples/example.dup b/examples/example.dup index 2c0c41d..f260d3a 100644 --- a/examples/example.dup +++ b/examples/example.dup @@ -170,7 +170,7 @@ exclude = /home/*/.gnupg ## desturl = file:///usr/local/backup ## desturl = rsync://user@other.host//var/backup/bla ## desturl = s3+http:// -## desturl = ftp://myftpuser[:myftppassword]@ftp.example.org/remote/ftp/path +## desturl = ftp://myftpuser@ftp.example.org/remote/ftp/path ## the default value of this configuration option is not set: ## ## Default: @@ -185,6 +185,11 @@ exclude = /home/*/.gnupg # awsaccesskeyid = # awssecretaccesskey = +## FTP password, needed for backups using desturl = ftp://... +## +## Default: +# ftp_password = + ## bandwith limit, in kbit/s ; default is 0, i.e. no limit ## if using 'desturl' above, 'bandwidthlimit' must not be set ## an example setting of 128 kbps would be: diff --git a/handlers/dup.helper.in b/handlers/dup.helper.in index a47064d..ea27844 100644 --- a/handlers/dup.helper.in +++ b/handlers/dup.helper.in @@ -430,13 +430,16 @@ keep = $dup_keep #desturl = file:///usr/local/backup #desturl = rsync://user@other.host//var/backup/bla #desturl = s3+http://your_bucket -#desturl = ftp://myftpuser[:myftppassword]@ftp.example.org/remote/ftp/path +#desturl = ftp://myftpuser@ftp.example.org/remote/ftp/path # 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 +# FTP password, needed for backups using desturl = ftp://... +#ftp_password = + # bandwith limit, in kbit/s ; default is 0, i.e. no limit # if using 'desturl' above, 'bandwidthlimit' must not be set # an example setting of 128 kbps would be: diff --git a/handlers/dup.in b/handlers/dup.in index b881b0a..4e0bbcf 100644 --- a/handlers/dup.in +++ b/handlers/dup.in @@ -29,6 +29,7 @@ getconf keep 60 getconf desturl getconf awsaccesskeyid getconf awssecretaccesskey +getconf ftp_password getconf sshoptions getconf bandwidthlimit 0 getconf desthost @@ -44,6 +45,9 @@ destdir=${destdir%/} 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 +if [ "`echo $desturl | @AWK@ -F ':' '{print $1}'`" == "ftp" ]; then + [ -n "$ftp_password" ] || fatal "ftp_password must be set for FTP backups." +fi ### VServers # If vservers are configured, check that the ones listed in $vsnames do exist. @@ -269,6 +273,7 @@ if [ "$duplicity_major" -ge 0 -a "$duplicity_minor" -ge 4 -a "$duplicity_sub" -g debug "$precmd duplicity cleanup --force $execstr_options $execstr_serverpart" if [ ! $test ]; then export PASSPHRASE=$password + export FTP_PASSWORD=$ftp_password output=`nice -n $nicelevel \ su -c \ "$precmd duplicity cleanup --force $execstr_options $execstr_serverpart 2>&1"` @@ -289,6 +294,7 @@ if [ "$keep" != "yes" ]; then debug "$precmd duplicity remove-older-than $keep --force $execstr_options $execstr_serverpart" if [ ! $test ]; then export PASSPHRASE=$password + export FTP_PASSWORD=$ftp_password output=`nice -n $nicelevel \ su -c \ "$precmd duplicity remove-older-than $keep --force $execstr_options $execstr_serverpart 2>&1"` @@ -309,6 +315,7 @@ debug "$precmd duplicity $execstr_command $execstr_options $execstr_source --exc if [ ! $test ]; then outputfile=`maketemp backupout` export PASSPHRASE=$password + export FTP_PASSWORD=$ftp_password output=`nice -n $nicelevel \ su -c \ "$precmd duplicity $execstr_command $execstr_options $execstr_source --exclude '**' / $execstr_serverpart >$outputfile 2>&1"` -- cgit v1.2.3 From d6ec2b4e62d1de94cf731381d7da934b6fee7ddc Mon Sep 17 00:00:00 2001 From: intrigeri Date: Mon, 10 May 2010 22:15:41 +0200 Subject: Store duplicity cache to /var/cache/backupninja/duplicity. ... instead of previous /var/backups/duplicity. --- ChangeLog | 4 ++-- NEWS | 7 ++++--- handlers/dup.in | 4 ++-- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 26cac5c..c9a8d43 100644 --- a/ChangeLog +++ b/ChangeLog @@ -11,8 +11,8 @@ version 0.9.8 -- UNRELEASED 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/backups/duplicity rather - than the default /root/.cache/duplicity, unless the user + . 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 diff --git a/NEWS b/NEWS index 50739f4..0ec3a81 100644 --- a/NEWS +++ b/NEWS @@ -3,8 +3,8 @@ backupninja (0.9.8-1) UNRELEASED * duplicity 0.6.01 and later defaults to using an archive (cache) directory, which was previously opt-in. Starting with backupninja 0.9.8, the backupninja duplicity handler puts this cache into - /var/backups/duplicity unless specified by the user with the "options" - setting the *.dup job. + /var/cache/backupninja/duplicity unless specified by the user with + the "options" setting the *.dup job. When backups have been performed with backupninja older than 0.9.8 in conjunction with duplicity 0.6.01 or later, e.g. when using Sid or Squeeze at certain times of the Squeeze release cycle, cache files @@ -12,7 +12,8 @@ backupninja (0.9.8-1) UNRELEASED delete these files, or rather save bandwidth and just move the cache directory to the new location: - mv /root/.cache/duplicity /var/backups/ + mkdir -p /var/cache/backupninja + mv /root/.cache/duplicity /var/cache/backupninja/ backupninja (0.9.7-1) UNRELEASED diff --git a/handlers/dup.in b/handlers/dup.in index 4e0bbcf..5216643 100644 --- a/handlers/dup.in +++ b/handlers/dup.in @@ -198,11 +198,11 @@ if [ -n "$tmpdir" ]; then fi ### Archive directory -# duplicity >= 0.6.01 enables the archive_dir by default, let's put it into /var/backups +# duplicity >= 0.6.01 enables the archive_dir by default, let's put it into /var/cache/backupninja/duplicity # unless the user has specified it. if [ "$duplicity_major" -ge 0 -a "$duplicity_minor" -ge 6 -a "$duplicity_sub" -ge 1 ]; then if echo "${options}" | grep -qv -- "--archive-dir" ; then - execstr_options="${execstr_options} --archive-dir /var/backups/duplicity" + execstr_options="${execstr_options} --archive-dir /var/cache/backupninja/duplicity" fi fi -- cgit v1.2.3 From 46ace6557309f85a7efeb0b877225053c5bb1552 Mon Sep 17 00:00:00 2001 From: intrigeri Date: Mon, 10 May 2010 22:18:49 +0200 Subject: Added /var/cache/backupninja/duplicity to default excludes. ... for rdiff.helper, dup.helper, example.dup and example.rdiff. --- examples/example.dup | 1 + examples/example.rdiff | 1 + handlers/dup.helper.in | 2 +- handlers/rdiff.helper.in | 2 +- 4 files changed, 4 insertions(+), 2 deletions(-) diff --git a/examples/example.dup b/examples/example.dup index f260d3a..0ed5b2a 100644 --- a/examples/example.dup +++ b/examples/example.dup @@ -135,6 +135,7 @@ include = /var/lib/dpkg/status-old # files to exclude from the backup exclude = /home/*/.gnupg +exclude = /var/cache/backupninja/duplicity ###################################################### ## destination section diff --git a/examples/example.rdiff b/examples/example.rdiff index 08e8869..5adecd8 100644 --- a/examples/example.rdiff +++ b/examples/example.rdiff @@ -122,6 +122,7 @@ include = /var/lib/dpkg/status-old ## files to exclude from the backup exclude = /home/*/.gnupg +exclude = /var/cache/backupninja/duplicity ###################################################### ## destination section diff --git a/handlers/dup.helper.in b/handlers/dup.helper.in index ea27844..e985c5e 100644 --- a/handlers/dup.helper.in +++ b/handlers/dup.helper.in @@ -552,7 +552,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/*/.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 /var/cache/backupninja/duplicity" set +o noglob dup_main_menu diff --git a/handlers/rdiff.helper.in b/handlers/rdiff.helper.in index e35d629..b5bb8bb 100644 --- a/handlers/rdiff.helper.in +++ b/handlers/rdiff.helper.in @@ -415,7 +415,7 @@ rdiff_wizard() { # Global variables whose '*' shall not be expanded set -o noglob rdiff_includes=(/var/spool/cron/crontabs /var/backups /etc /root /home /usr/local/*bin /var/lib/dpkg/status*) - rdiff_excludes=(/home/*/.gnupg /home/*/.local/share/Trash /home/*/.Trash /home/*/.thumbnails /home/*/.beagle /home/*/.aMule /home/*/gtk-gnutella-downloads) + rdiff_excludes=(/home/*/.gnupg /home/*/.local/share/Trash /home/*/.Trash /home/*/.thumbnails /home/*/.beagle /home/*/.aMule /home/*/gtk-gnutella-downloads /var/cache/backupninja/duplicity) rdiff_vsincludes= set +o noglob -- cgit v1.2.3 From 4015b1b2620f9e44a32a552cd274a902f2f913cb Mon Sep 17 00:00:00 2001 From: intrigeri Date: Mon, 10 May 2010 22:22:25 +0200 Subject: NEWS: added note about excluding duplicity cache dir. --- NEWS | 3 +++ 1 file changed, 3 insertions(+) diff --git a/NEWS b/NEWS index 0ec3a81..9867b54 100644 --- a/NEWS +++ b/NEWS @@ -15,6 +15,9 @@ backupninja (0.9.8-1) UNRELEASED mkdir -p /var/cache/backupninja mv /root/.cache/duplicity /var/cache/backupninja/ + It is probably desirable to exclude this cache directory from + duplicity backup sets to avoid some kind of reentrant backup problem. + backupninja (0.9.7-1) UNRELEASED * mysql: output filenames to support shell meta-characters in -- cgit v1.2.3 From 211d6506cbde8091cb0d6574bb43515cf916166b Mon Sep 17 00:00:00 2001 From: intrigeri Date: Sun, 30 May 2010 19:35:52 +0200 Subject: Fix typo in manpage (Closes: #583778) --- ChangeLog | 3 +++ man/backupninja.1 | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index c9a8d43..66bc1e7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -17,6 +17,9 @@ version 0.9.8 -- UNRELEASED . Better example.dup documentation. Thanks, Alster! . Added ftp_password option to securely transmit the FTP password from backupninja to duplicity. + doc changes + manpage: + . Fix typo in manpage (Closes: #583778) version 0.9.7 -- January 27, 2010 backupninja changes diff --git a/man/backupninja.1 b/man/backupninja.1 index 53b1e3c..5622881 100644 --- a/man/backupninja.1 +++ b/man/backupninja.1 @@ -96,7 +96,7 @@ To preform the actual backup actions, backupninja processes each action configur .SH EXAMPLE USAGE .TP -Backupninja can be used to impliment whatever backup strategy you choose. It is intended, however, to be used like so: +Backupninja can be used to implement whatever backup strategy you choose. It is intended, however, to be used like so: .TP First, databases are safely copied or exported to /var/backups. Often, you cannot make a file backup of a database while it is in use, hence the need to use special tools to make a safe copy or export into /var/backups. .TP -- cgit v1.2.3 From aeca6912a8f67ecf69ba9b8a436a2a695e5f3acc Mon Sep 17 00:00:00 2001 From: intrigeri Date: Mon, 14 Jun 2010 19:06:59 +0200 Subject: 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). --- ChangeLog | 5 +++++ etc/backupninja.conf.in | 1 + handlers/ldap.in | 2 +- handlers/mysql.in | 4 ++-- handlers/pgsql.in | 8 ++++---- src/backupninja.in | 1 + 6 files changed, 14 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 66bc1e7..e3c8608 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,9 @@ version 0.9.8 -- UNRELEASED + 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) diff --git a/etc/backupninja.conf.in b/etc/backupninja.conf.in index de1fbf3..dee9fff 100644 --- a/etc/backupninja.conf.in +++ b/etc/backupninja.conf.in @@ -86,6 +86,7 @@ vservers = no # 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 diff --git a/handlers/ldap.in b/handlers/ldap.in index fda24d0..83307ee 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 --rsyncable > $dumpdir/$dbsuffix.ldif.gz" + execstr="$execstr | $GZIP $GZIP_OPTS > $dumpdir/$dbsuffix.ldif.gz" else execstr="$execstr > $dumpdir/$dbsuffix.ldif" fi diff --git a/handlers/mysql.in b/handlers/mysql.in index 3488c51..4dece24 100644 --- a/handlers/mysql.in +++ b/handlers/mysql.in @@ -279,7 +279,7 @@ 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 $GZIP_OPTS > '$vroot$dumpdir/${db}.sql.gz'" else execstr="$VSERVER $vsname exec $DUMP -r '$vroot$dumpdir/${db}.sql'" fi @@ -290,7 +290,7 @@ 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 $GZIP_OPTS > '$dumpdir/${db}.sql.gz'" else execstr="$DUMP -r '$dumpdir/${db}.sql'" fi diff --git a/handlers/pgsql.in b/handlers/pgsql.in index 77a73fe..0b7badf 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 \"set -o pipefail ; $PGSQLDUMPALL | $GZIP --rsyncable > '$backupdir/${vsname}.sql.gz'\"" + execstr="$VSERVER $vsname exec su - $PGSQLUSER -c \"set -o pipefail ; $PGSQLDUMPALL | $GZIP $GZIP_OPTS > '$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 \"set -o pipefail ; $PGSQLDUMPALL | $GZIP --rsyncable > '$backupdir/${localhost}-all.sql.gz'\"" + execstr="su - $PGSQLUSER -c \"set -o pipefail ; $PGSQLDUMPALL | $GZIP $GZIP_OPTS > '$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 \"set -o pipefail ; $PGSQLDUMP $db | $GZIP --rsyncable > '$backupdir/${db}.sql.gz'\"" + execstr="$VSERVER $vsname exec su - $PGSQLUSER -c \"set -o pipefail ; $PGSQLDUMP $db | $GZIP $GZIP_OPTS > '$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 \"set -o pipefail ; $PGSQLDUMP $db | $GZIP --rsyncable > '$backupdir/${db}.sql.gz'\"" + execstr="su - $PGSQLUSER -c \"set -o pipefail ; $PGSQLDUMP $db | $GZIP $GZIP_OPTS > '$backupdir/${db}.sql.gz'\"" else execstr="su - $PGSQLUSER -c \"$PGSQLDUMP $db > '$backupdir/${db}.sql'\"" fi diff --git a/src/backupninja.in b/src/backupninja.in index e8a820f..b397a14 100755 --- a/src/backupninja.in +++ b/src/backupninja.in @@ -480,6 +480,7 @@ getconf PGSQLDUMP /usr/bin/pg_dump getconf PGSQLDUMPALL /usr/bin/pg_dumpall getconf PGSQLUSER postgres getconf GZIP /bin/gzip +getconf GZIP_OPTS --rsyncable getconf RSYNC /usr/bin/rsync getconf admingroup root -- cgit v1.2.3 From 6e2a9468cf66b2b58ab4340eb00dda352ee8f613 Mon Sep 17 00:00:00 2001 From: intrigeri Date: Mon, 14 Jun 2010 19:13:49 +0200 Subject: Fix ssl and tls options description (Closes Roundup bug #2407) --- ChangeLog | 3 +++ examples/example.ldap | 11 ++++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index e3c8608..5de8552 100644 --- a/ChangeLog +++ b/ChangeLog @@ -25,6 +25,9 @@ version 0.9.8 -- UNRELEASED 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 diff --git a/examples/example.ldap b/examples/example.ldap index 3a962f1..174ed1d 100644 --- a/examples/example.ldap +++ b/examples/example.ldap @@ -46,6 +46,11 @@ ## ldaphost (no default): set this to your ldap host if it is not local # ldaphost = -## tls (default yes): if set to 'yes' then TLS connection will be -## attempted to your ldaphost by using the URI base ldaps: otherwise ldap: will be used -# tls = yes +## ssl (default yes): if set to 'yes' then SSL connection will be +## attempted to your ldaphost by using ldaps:// +# ssl = yes + +## tls (default no): if set to 'yes' then TLS connection will be +## attempted to your ldaphost by using TLS extended operations (RFC2246, +## RFC2830) +# tls = no -- cgit v1.2.3 From 9179c59b50ddf1a8e11817924df7f589a76500b4 Mon Sep 17 00:00:00 2001 From: intrigeri Date: Thu, 24 Jun 2010 16:18:44 +0200 Subject: mysql: don't lock tables in the information_schema database (Closes: #587011) --- ChangeLog | 3 +++ handlers/mysql.in | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/ChangeLog b/ChangeLog index 5de8552..8dec95c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -22,6 +22,9 @@ version 0.9.8 -- UNRELEASED . 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) doc changes manpage: . Fix typo in manpage (Closes: #583778) diff --git a/handlers/mysql.in b/handlers/mysql.in index 4dece24..68d5197 100644 --- a/handlers/mysql.in +++ b/handlers/mysql.in @@ -255,6 +255,10 @@ then for db in $databases do DUMP_BASE="$MYSQLDUMP $defaultsfile $sqldumpoptions" + if [ "$db" = "information_schema" ] + then + DUMP_BASE="${DUMP_BASE} --skip-lock-tables" + fi # Dumping structure and data DUMP="$DUMP_BASE $ignore $db" -- cgit v1.2.3 From 40155781065eb7254eb9fc9c48bd85b0b8ace4c0 Mon Sep 17 00:00:00 2001 From: intrigeri Date: Thu, 24 Jun 2010 16:53:58 +0200 Subject: Fix code logic to make dbusername/dbpassword actually usable (Closes Redmine bug #2264) --- AUTHORS | 1 + ChangeLog | 2 ++ handlers/mysql.in | 15 ++++++++------- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/AUTHORS b/AUTHORS index 92a2184..8c1d1c8 100644 --- a/AUTHORS +++ b/AUTHORS @@ -34,3 +34,4 @@ Olivier Berger -- much work on the dup handler stefan -- dup support for Amazon S3 buckets maniacmartin -- rdiff confusing error message fix Chris Nolan -- maildir subdirectory expansion +Dan Carley -- mysql bugfix diff --git a/ChangeLog b/ChangeLog index 8dec95c..dd8f605 100644 --- a/ChangeLog +++ b/ChangeLog @@ -25,6 +25,8 @@ version 0.9.8 -- UNRELEASED 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) doc changes manpage: . Fix typo in manpage (Closes: #583778) diff --git a/handlers/mysql.in b/handlers/mysql.in index 68d5197..0282046 100644 --- a/handlers/mysql.in +++ b/handlers/mysql.in @@ -86,7 +86,7 @@ fi defaultsfile="" -if [ "$dbusername" != "" -a "$dbpassword" != "" ] +if [ -n "$dbusername" -a -n "$dbpassword" ] then if [ $usevserver = yes ] then @@ -140,13 +140,10 @@ password="$dbpassword" EOF umask $oldmask defaultsfile="--defaults-extra-file=$mycnf" -fi -# if a user is not set, use $configfile, otherwise use $mycnf -if [ "$user" == "" ]; then - user=root; - defaultsfile="--defaults-extra-file=$configfile" -else +# else, if a user is set use her .my.cnf +elif [ -n "$user" ] +then userset=true; if [ $usevserver = yes ] then @@ -169,6 +166,10 @@ else defaultsfile="--defaults-extra-file=$userhome/.my.cnf" debug "using $defaultsfile" +# otherwise use $configfile +else + user=root + defaultsfile="--defaults-extra-file=$configfile" fi ####################################################################### -- cgit v1.2.3