dup: new tmpdir config option, useful when duplicity fills up /tmp
authorintrigeri <intrigeri@boum.org>
Mon, 26 Nov 2007 07:42:24 +0000 (07:42 +0000)
committerintrigeri <intrigeri@boum.org>
Mon, 26 Nov 2007 07:42:24 +0000 (07:42 +0000)
ChangeLog
examples/example.dup
handlers/dup.in

index ef6db698e62a696fa4c7ff0af0665f6ccfc4f2f7..24e7e38a8c2c70ee105313c7f12e22469a7f5e71 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -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)
        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
         ldap:
         . Fixed shell command quoting issues, missing 'then' clauses, cleaned up
           compress=yes to be less redundant and not create empty uncompressed
index 0e7ed950651a046118460b9982135085e0723467..d490f745f3777458e72f5af8e2b74ecb27b12823 100644 (file)
@@ -8,6 +8,10 @@ nicelevel = 19
 # default is yes. set to no to skip the test if the remote host is alive
 #testconnect = no
 
 # 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)
 ######################################################
 ## gpg section
 ## (how to encrypt and optionally sign the backups)
index 4b286a36c6003bf301e5e33cc645d549822a24b6..417b625d94df012e059589379440d14070231fcf 100644 (file)
@@ -7,6 +7,7 @@
 getconf options
 getconf testconnect yes
 getconf nicelevel 0
 getconf options
 getconf testconnect yes
 getconf nicelevel 0
+getconf tmpdir
 
 setsection gpg
 getconf password
 
 setsection gpg
 getconf password
@@ -170,16 +171,28 @@ fi
 
 set +o noglob
 
 
 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//\\*/\\\\\\*}
 
 ### 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 \
 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
        code=$?
        if [ $code -eq 0 ]; then
                debug $output