summaryrefslogtreecommitdiff
path: root/rdiff-backup/rdiff_backup
diff options
context:
space:
mode:
authorowsla <owsla@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109>2007-07-18 21:52:11 +0000
committerowsla <owsla@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109>2007-07-18 21:52:11 +0000
commit467844f89ee7e0feee26effdffc0bddc456ab39f (patch)
tree9ef1a21ce45e999840930cab9c5830c704bc1f20 /rdiff-backup/rdiff_backup
parentc0f124d8ed1585a4b852eabe0ed938b4d612b827 (diff)
downloadrdiff-backup-467844f89ee7e0feee26effdffc0bddc456ab39f.tar.gz
Add --tempfile and --remote-tempfile options.
git-svn-id: http://svn.savannah.nongnu.org/svn/rdiff-backup/trunk@829 2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109
Diffstat (limited to 'rdiff-backup/rdiff_backup')
-rw-r--r--rdiff-backup/rdiff_backup/Globals.py4
-rw-r--r--rdiff-backup/rdiff_backup/Main.py10
-rw-r--r--rdiff-backup/rdiff_backup/SetConnections.py3
3 files changed, 13 insertions, 4 deletions
diff --git a/rdiff-backup/rdiff_backup/Globals.py b/rdiff-backup/rdiff_backup/Globals.py
index c130143..9a71ce9 100644
--- a/rdiff-backup/rdiff_backup/Globals.py
+++ b/rdiff-backup/rdiff_backup/Globals.py
@@ -226,6 +226,10 @@ permission_mask = 07777
# the original permissions
symlink_perms = None
+# If set, the path that should be used instead of the default Python
+# tempfile.tempdir value on remote connections
+remote_tempdir = None
+
def get(name):
"""Return the value of something in this module"""
return globals()[name]
diff --git a/rdiff-backup/rdiff_backup/Main.py b/rdiff-backup/rdiff_backup/Main.py
index a363aa5..cf3be6c 100644
--- a/rdiff-backup/rdiff_backup/Main.py
+++ b/rdiff-backup/rdiff_backup/Main.py
@@ -20,7 +20,7 @@
"""Start (and end) here - read arguments, set global settings, etc."""
from __future__ import generators
-import getopt, sys, re, os, cStringIO
+import getopt, sys, re, os, cStringIO, tempfile
from log import Log, LoggerError, ErrorLog
import Globals, Time, SetConnections, selection, robust, rpath, \
manage, backup, connection, restore, FilenameMapping, \
@@ -81,11 +81,11 @@ def parse_cmdlineoptions(arglist):
"no-eas", "no-file-statistics", "no-hard-links", "null-separator",
"override-chars-to-quote=", "parsable-output",
"preserve-numerical-ids", "print-statistics",
- "remote-cmd=", "remote-schema=",
+ "remote-cmd=", "remote-schema=", "remote-tempdir=",
"remove-older-than=", "restore-as-of=", "restrict=",
"restrict-read-only=", "restrict-update-only=", "server",
- "ssh-no-compression", "terminal-verbosity=", "test-server",
- "user-mapping-file=", "verbosity=", "verify",
+ "ssh-no-compression", "tempdir=", "terminal-verbosity=",
+ "test-server", "user-mapping-file=", "verbosity=", "verify",
"verify-at-time=", "version"])
except getopt.error, e:
commandline_error("Bad commandline options: " + str(e))
@@ -176,6 +176,7 @@ def parse_cmdlineoptions(arglist):
restore_timestr, action = arg, "restore-as-of"
elif opt == "--remote-cmd": remote_cmd = arg
elif opt == "--remote-schema": remote_schema = arg
+ elif opt == "--remote-tempdir": Globals.remote_tempdir = arg
elif opt == "--remove-older-than":
remove_older_than_string = arg
action = "remove-older-than"
@@ -193,6 +194,7 @@ def parse_cmdlineoptions(arglist):
Globals.server = 1
elif opt == "--ssh-no-compression":
Globals.set('ssh_compression', None)
+ elif opt == "--tempdir": tempfile.tempdir = arg
elif opt == "--terminal-verbosity": Log.setterm_verbosity(arg)
elif opt == "--test-server": action = "test-server"
elif opt == "--user-mapping-file": user_mapping_filename = arg
diff --git a/rdiff-backup/rdiff_backup/SetConnections.py b/rdiff-backup/rdiff_backup/SetConnections.py
index 9341db9..0d30cf0 100644
--- a/rdiff-backup/rdiff_backup/SetConnections.py
+++ b/rdiff-backup/rdiff_backup/SetConnections.py
@@ -52,6 +52,9 @@ def get_cmd_pairs(arglist, remote_schema = None, remote_cmd = None):
if remote_schema: __cmd_schema = remote_schema
elif not Globals.ssh_compression: __cmd_schema = __cmd_schema_no_compress
+ if Globals.remote_tempdir:
+ __cmd_schema += (" --tempdir=" + Globals.remote_tempdir)
+
if not arglist: return []
desc_pairs = map(parse_file_desc, arglist)