From 9038d007be9dc875211f8e2d40a25e0ad12e58b4 Mon Sep 17 00:00:00 2001 From: "d. johnson" Date: Sat, 2 Aug 2014 00:16:56 -0500 Subject: Move generated config output to /root. --- duplicity-backups.sh | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'duplicity-backups.sh') diff --git a/duplicity-backups.sh b/duplicity-backups.sh index ee5b272..eb655a3 100755 --- a/duplicity-backups.sh +++ b/duplicity-backups.sh @@ -14,6 +14,10 @@ # Where to upload the backups BACKUP_URL="sftp://User@BackupHost.local.lan//home/duplicity/$HOSTNAME/" +# Setup temporary directories +export TMPDIR=$( /bin/mktemp -d /var/tmp/${0##*/}.XXXXXXXXXX ) || { echo "mktemp failed" >&2 ; exit 1 ; }; +export ROOT_TMPDIR=/root/gen-backups && [ -d "${ROOT_TMPDIR}" ] || mkdir -p "${ROOT_TMPDIR}" + # Extra duplicity options EXTRA_DUPLICITY=" --allow-source-mismatch \ @@ -25,9 +29,6 @@ EXTRA_DUPLICITY=" " # Additional TMP space needed, but may make it faster: --asynchronous-upload \ -# Loading the day of the month in a variable. -export TMPDIR=/var/tmp - # Check to see if we have a SSH key if [ ! -e /root/.ssh/id_rsa ]; then /bin/cat - < ${TMPDIR}/YUM-REPOLIST.txt -/usr/sbin/semanage -o ${TMPDIR}/SELINUX-CUSTOM-CONFIG.txt +/usr/bin/show-installed -f kickstart -o ${ROOT_TMPDIR}/SHOW-INSTALLED2.txt +/usr/bin/yum repolist > ${ROOT_TMPDIR}/YUM-REPOLIST.txt +/usr/sbin/semanage -o ${ROOT_TMPDIR}/SELINUX-CUSTOM-CONFIG.txt # Directories to backup /bin/cat - > ${TMPDIR}/duplicity-backups.txt <> /var/log/duplicity.log # Unsetting the confidential variables so they are gone for sure. unset PASSPHRASE +/bin/rm $TMPDIR/duplicity-backups.txt +/bin/rmdir $TMPDIR exit 0 #EOF -- cgit