Added borg prune section and warning if no parameters provided.

This commit is contained in:
Asif Bacchus 2018-10-14 06:56:25 -06:00
parent 59290a1011
commit 5d72b987f3
1 changed files with 13 additions and 1 deletions

View File

@ -184,7 +184,7 @@ warn503="Web users will NOT be informed the server is down!"
warningExplain[borg111]="No password used for SSH keys or access remote borg repo. This is an insecure configuration."
warningExplain[borg112]="No remote borg instance specified. Operations will be slower in this configuration."
warningExplain[borg113]="The specified file containing extra files for inclusion in borgbackup could not be found"
warningExplain[borg115]="No paramters provided for borg prune. No repo pruning has taken place. You should reconsider this decision to control the size/history of your backups."
### Process script parameters
@ -523,6 +523,18 @@ else
"${sqlDumpDir}" "${ncDataDir}"
fi
## Generate and execute borg prune
# command depends on whether or not parameters have been defined
if [ -n "$borgPrune" ]; then
# parameters defined
echo -e "${op}${stamp} Executing borg prune operation${normal}" \
>> "$logFile"
borg --show-rc prune -v ${borgPruneParams} "${borgPrune}"
else
# parameters not defined... skip pruning
exitWarn+=('borg115')
fi
### Exit NextCloud maintenance mode
ncMaint off