From d3c21028b004b7257fb9512d31ac4e1b3c0e8fd8 Mon Sep 17 00:00:00 2001 From: Philip Date: Sun, 18 Jan 2015 14:50:35 +0000 Subject: [PATCH] If we create the log dir chown it to log file owner --- duplicity-backup.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/duplicity-backup.sh b/duplicity-backup.sh index 745e635..af88800 100755 --- a/duplicity-backup.sh +++ b/duplicity-backup.sh @@ -281,6 +281,14 @@ check_logdir() else echo "Directory ${LOGDIR} successfully created." fi + echo "Attempting to change owner:group of ${LOGDIR} to ${LOG_FILE_OWNER} ..." + if ! chown ${LOG_FILE_OWNER} ${LOGDIR}; then + echo "User ${USER} could not change the owner:group of ${LOGDIR} to $LOG_FILE_OWNER" + echo "Aborting..." + exit 1 + else + echo "Directory ${LOGDIR} successfully changed to owner:group of ${LOG_FILE_OWNER}" + fi elif [ ! -w ${LOGDIR} ]; then echo "Log directory ${LOGDIR} is not writeable by this user: ${USER}" echo "Aborting..."