diff options
author | Philippe Mazet <philippe.mazet@nxp.com> | 2019-11-21 15:10:49 +0100 |
---|---|---|
committer | Philippe Mazet <philippe.mazet@nxp.com> | 2019-12-06 18:04:32 +0100 |
commit | 87eff59f943ed44cc9d568602ed9e2756088398c (patch) | |
tree | 8ca9fd1610c691b520525eb4a8517890cebf5db7 /backup.sh | |
parent | 87ebea7e5ec96558bd2c9688fecd9b3b2d8e2a3d (diff) |
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
Diffstat (limited to 'backup.sh')
-rwxr-xr-x | backup.sh | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -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 |