From 19d1eb15870e05c688d1ac29f63e59bdd18fdb62 Mon Sep 17 00:00:00 2001 From: Asif Bacchus Date: Mon, 8 Mar 2021 00:40:11 -0700 Subject: [PATCH] refactor(BACKUP): prevent alias cmds - prefix cp and cd with \ to prevent alias cmd - fix typo in comment --- backup/backup.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/backup/backup.sh b/backup/backup.sh index a7881c2..e6b70f1 100755 --- a/backup/backup.sh +++ b/backup/backup.sh @@ -257,7 +257,7 @@ trapExit() { ## script related # store logfile in the same directory as this script file using the same file # name as the script but with the extension '.log' -scriptPath="$( CDPATH='' cd -- "$( dirname -- "$0" )" && pwd -P )" +scriptPath="$( CDPATH='' \cd -- "$( dirname -- "$0" )" && pwd -P )" scriptName="$( basename "$0" )" logFile="$scriptPath/${scriptName%.*}.log" colourizeLogFile=1 @@ -593,7 +593,7 @@ fi ## export borg remote path, if specified if [ -n "${borgRemote}" ]; then export BORG_REMOTE_PATH="${borgRemote}"; fi -## check if exlusion list file is specified +## check if exclusion list file is specified if [ -n "${borgExcludeListPath}" ]; then # check if the file actually exists if [ ! -f "${borgExcludeListPath}" ]; then @@ -661,7 +661,7 @@ if [ "$use503" -eq 1 ]; then printf "%s[%s] -- [INFO] Copying 503 error page to " \ "$cyan" "$(stamp)" >> "$logFile" printf "webroot -- %s\n" "$norm">> "$logFile" - if ! cp --force "${err503Path}" "${webroot}/${err503File}" 2>> "$logFile" + if ! \cp --force "${err503Path}" "${webroot}/${err503File}" 2>> "$logFile" then printf "%s[%s] -- [WARNING] Failed to copy 503 error page. " \ "$warn" "$(stamp)" >> "$logFile"