Compare commits
3 Commits
37449382b2
...
a2b462c202
Author | SHA1 | Date |
---|---|---|
Asif Bacchus | a2b462c202 | |
Asif Bacchus | 646d4976fd | |
Asif Bacchus | 34bae9d580 |
|
@ -58,7 +58,7 @@ function scriptHelp {
|
|||
echo -e "this file are in the readme and on ${lit}https://mytechiethoughts.com${default}"
|
||||
echo -e "${info}Default: ScriptPath/nc_borg.details${default}"
|
||||
echo -e "${lit}\n-l, Location to save log file${default}"
|
||||
echo -e "This script writes a detailed log file of all activities. It is"
|
||||
echo -e "This script writes a detailed log file of all activities. It is"
|
||||
echo -e "structured in an way easy for log parsers (like Logwatch) to read."
|
||||
echo -e "${info}Default: ScriptPath/ScriptName.log${default}"
|
||||
echo -e "${lit}\n-s, Location of file with mySQL details${default}"
|
||||
|
@ -373,7 +373,7 @@ if [ -z "$webUser" ]; then
|
|||
# Check if supplied webUser account exists
|
||||
elif [ -n "$webUser" ]; then
|
||||
user_exists=$(id -u $webUser > /dev/null 2>&1; echo $?)
|
||||
if [ $user_exists -ne 0 ]; then
|
||||
if [ $user_exists -ne 0 ]; then
|
||||
echo -e "\n${err}The supplied webuser account (-u parameter) does not" \
|
||||
"exist.${normal}\n"
|
||||
exit 1
|
||||
|
@ -420,8 +420,10 @@ fi
|
|||
|
||||
|
||||
### Log start of script operations
|
||||
echo -e "${note}${stamp}-- Start $scriptName execution ---${normal}" \
|
||||
echo -e "${note}${stamp}--- Start $scriptName execution ---${normal}" \
|
||||
>> "$logFile"
|
||||
echo -e "${info}${stamp}-- [INFO] Log file located at ${lit}${logFile}${info}" \
|
||||
"--${normal}" >> "$logFile"
|
||||
|
||||
|
||||
### Export logFile variable for use by Borg
|
||||
|
@ -435,7 +437,7 @@ echo -e "${info}${stamp} -- [INFO] mySQL dump file will be stored" \
|
|||
"at: ${lit}${sqlDumpDir}/${sqlDumpFile}${normal}" >> "$logFile"
|
||||
|
||||
|
||||
### 503 error page: If you dont' plan on using the auto-copied 503 then comment
|
||||
### 503 error page: If you don't plan on using the auto-copied 503 then comment
|
||||
### this entire section starting with '--- Begin 503 section ---' until
|
||||
### '--- End 503 section ---' to suppress generated warnings
|
||||
|
||||
|
@ -692,16 +694,16 @@ export TMPDIR="${BORG_BASE_DIR}/tmp"
|
|||
# commandline depends on whether borgExclude is empty or not
|
||||
if [ -z "$borgExclude" ]; then
|
||||
# borgExclude is empty
|
||||
echo -e "${bold}${op}${stamp} Executing borg without exclusions${normal}" \
|
||||
>> "$logFile"
|
||||
echo -e "${info}${stamp} --[INFO] Executing borg without exclusions --" \
|
||||
"${normal}" >> "$logFile"
|
||||
borg --show-rc create ${borgCreateParams} ::`date +%Y-%m-%d_%H%M%S` \
|
||||
${xtraFiles[@]} \
|
||||
${sqlDumpDir} ${ncDataDir} \
|
||||
2>> "$logFile"
|
||||
else
|
||||
# borgExclude is not empty
|
||||
echo -e "${bold}${op}${stamp} Executing borg with exclusions${normal}" \
|
||||
>> "$logFile"
|
||||
echo -e "${info}${stamp} --[INFO] Executing borg with exclusions --" \
|
||||
"${normal}" >> "$logFile"
|
||||
borg --show-rc create ${borgCreateParams} --exclude-from ${borgExclude} \
|
||||
::`date +%Y-%m-%d_%H%M%S` \
|
||||
${xtraFiles[@]} \
|
||||
|
@ -728,8 +730,8 @@ fi
|
|||
# command depends on whether or not parameters have been defined
|
||||
if [ -n "$borgPrune" ]; then
|
||||
# parameters defined
|
||||
echo -e "${bold}${op}${stamp} Executing borg prune operation${normal}" \
|
||||
>> "$logFile"
|
||||
echo -e "${info}${stamp} --[INFO] Executing borg prune operation --" \
|
||||
"${normal}" >> "$logFile"
|
||||
borg prune --show-rc -v ${borgPruneParams} ${borgPrune} \
|
||||
2>> "$logFile"
|
||||
# check return-status
|
||||
|
@ -760,7 +762,7 @@ echo -e "${bold}${op}${stamp} ***Normal exit process***${normal}" \
|
|||
>> "$logFile"
|
||||
cleanup
|
||||
echo -e "${bold}${ok}${stamp} -- [SUCCESS] All processes completed" \
|
||||
"successfully --${normal}" >> "$logFile"
|
||||
"successfully --${normal}" >> "$logFile"
|
||||
quit
|
||||
|
||||
# This code should not be executed since the 'quit' function should terminate
|
||||
|
|
Loading…
Reference in New Issue