From 87eff59f943ed44cc9d568602ed9e2756088398c Mon Sep 17 00:00:00 2001 From: Philippe Mazet Date: Thu, 21 Nov 2019 15:10:49 +0100 Subject: backup.sh: allow using different tmp dir When backup size grows, we had cases where tar was filling up /tmp This patch allows specifying a different tmp dir, used by tar (through TMPDIR variable). Example usage: TMPDIR=/home/user/mytempdir ./backup.sh --- backup.sh | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'backup.sh') diff --git a/backup.sh b/backup.sh index f4cf1de..33323b7 100755 --- a/backup.sh +++ b/backup.sh @@ -1,6 +1,11 @@ #!/bin/sh BACKUP_DIR="backup-$(date +%Y%m%d_%H%M)" +# use /tmp by default on host (this is used by tar) +TMPDIR=${TMPDIR:-/tmp} +export TMPDIR + +mkdir -p $TMPDIR mkdir $BACKUP_DIR cp boards.yaml $BACKUP_DIR -- cgit 1.2.3-korg