From 08c256542068ca2708b7c226f747fb96057a041b Mon Sep 17 00:00:00 2001 From: raTMole <ratmole@gmail.com> Date: Mon, 30 Nov 2020 13:02:38 +0200 Subject: [PATCH] rdiff: new tempdir config option, useful when rdiff-backup fills up /tmp --- examples/example.rdiff | 6 ++++++ handlers/rdiff.in | 13 +++++++++++++ 2 files changed, 19 insertions(+) diff --git a/examples/example.rdiff b/examples/example.rdiff index 323b3eb..0062984 100644 --- a/examples/example.rdiff +++ b/examples/example.rdiff @@ -66,6 +66,12 @@ ## ## Default: # output_as_info = no +# + +# temporary directory used by rdiff-backup +# (default = /tmp or /usr/tmp, depending on the system) +#tempdir = /tmp + ###################################################### ## source section diff --git a/handlers/rdiff.in b/handlers/rdiff.in index 2a06d2e..7adecc8 100644 --- a/handlers/rdiff.in +++ b/handlers/rdiff.in @@ -86,6 +86,7 @@ getconf nicelevel 0 getconf bwlimit getconf ignore_version no getconf output_as_info no +getconf tempdir setsection source getconf type; sourcetype=$type @@ -214,6 +215,18 @@ fi execstr="$RDIFFBACKUP $options --print-statistics " +### Temporary directory +if [ -n "$tempdir" ]; then + if [ ! -d "$tempdir" ]; then + info "Temporary directory ($tempdir) does not exist, creating it." + mkdir -p "$tempdir" + [ $? -eq 0 ] || fatal "Could not create temporary directory ($tempdir)." + chmod 0700 "$tempdir" + fi + info "Using $tempdir as TEMPDIR" + execstr="${execstr} --tempdir '$tempdir' " +fi + set -o noglob symlinks_warning="Maybe you have mixed symlinks and '*' in this statement, which is not supported." -- GitLab