From 21533c6fb942928480a9c3be2589e5c0c8f99ba9 Mon Sep 17 00:00:00 2001 From: Brice Waegeneire Date: Fri, 22 Mar 2024 10:05:10 +0100 Subject: [PATCH] client: Write temporary files in /tmp By default "mktemp" creates a temporary file in the current working directory, which in the context of Debian's cron is /. To avoid littering /, we add the option "--tmpdir" that use $TMPDIR or /tmp instead. --- client/zzz_evobackup | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/zzz_evobackup b/client/zzz_evobackup index 96ab93a..a075cef 100755 --- a/client/zzz_evobackup +++ b/client/zzz_evobackup @@ -399,8 +399,8 @@ build_rsync_main_cmd() { ################################################################### # Create a temp file for excludes and includes - includes_file="$(mktemp "${PROGNAME}.includes.XXXXXX")" - excludes_file="$(mktemp "${PROGNAME}.excludes.XXXXXX")" + includes_file="$(mktemp --tmpdir "${PROGNAME}.includes.XXXXXX")" + excludes_file="$(mktemp --tmpdir "${PROGNAME}.excludes.XXXXXX")" # … and add them to the list of files to delete at exit temp_files="${includes_file} ${excludes_file}" trap "rm -f ${temp_files}" EXIT