diff options
author | intrigeri <intrigeri@boum.org> | 2007-11-26 07:42:24 +0000 |
---|---|---|
committer | intrigeri <intrigeri@boum.org> | 2007-11-26 07:42:24 +0000 |
commit | 8ed22e66fed72343e87740a235b0544faddd1d33 (patch) | |
tree | 345b23468239641f1c3e75857485010a8ae118eb | |
parent | 440a0ef9b39e998c8ad0ca7c8a6e9d1644de23d1 (diff) | |
download | backupninja-8ed22e66fed72343e87740a235b0544faddd1d33.tar.gz backupninja-8ed22e66fed72343e87740a235b0544faddd1d33.tar.bz2 |
dup: new tmpdir config option, useful when duplicity fills up /tmp
-rw-r--r-- | ChangeLog | 2 | ||||
-rw-r--r-- | examples/example.dup | 4 | ||||
-rw-r--r-- | handlers/dup.in | 17 |
3 files changed, 21 insertions, 2 deletions
@@ -18,6 +18,8 @@ version 0.9.5 -- unreleased 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 diff --git a/examples/example.dup b/examples/example.dup index 0e7ed95..d490f74 100644 --- a/examples/example.dup +++ b/examples/example.dup @@ -8,6 +8,10 @@ nicelevel = 19 # default is yes. set to no to skip the test if the remote host is alive #testconnect = no +# temporary directory used by duplicity +# (default = /tmp or /usr/tmp, depending on the system) +#tmpdir = /var/tmp/duplicity + ###################################################### ## gpg section ## (how to encrypt and optionally sign the backups) diff --git a/handlers/dup.in b/handlers/dup.in index 4b286a3..417b625 100644 --- a/handlers/dup.in +++ b/handlers/dup.in @@ -7,6 +7,7 @@ getconf options getconf testconnect yes getconf nicelevel 0 +getconf tmpdir setsection gpg getconf password @@ -170,16 +171,28 @@ fi set +o noglob +### deal with tmpdir ### +precmd= +if [ -n "$tmpdir" ]; then + if [ ! -d "$tmpdir" ]; then + info "Temporary directory ($tmpdir) does not exist, creating it." + mkdir -p "$tmpdir" + [ $? -eq 0 ] || fatal "Could not create temporary directory ($tmpdir)." + fi + info "Using $tmpdir as TMPDIR" + precmd="${precmd}TMPDIR=$tmpdir " +fi + ### EXECUTE ### execstr=${execstr//\\*/\\\\\\*} -debug "duplicity $execstr --exclude '**' / $execstr_serverpart" +debug "$precmd duplicity $execstr --exclude '**' / $execstr_serverpart" if [ ! $test ]; then export PASSPHRASE=$password output=`nice -n $nicelevel \ su -c \ - "duplicity $execstr --exclude '**' / $execstr_serverpart 2>&1"` + "$precmd duplicity $execstr --exclude '**' / $execstr_serverpart 2>&1"` code=$? if [ $code -eq 0 ]; then debug $output |