Updated in-script help

This commit is contained in:
Asif Bacchus 2018-10-21 01:46:32 -06:00
parent 00e31c25a5
commit 532bee722b

View File

@ -20,31 +20,35 @@ stamp="[`date +%Y-%m-%d` `date +%H:%M:%S`]"
### scriptHelp -- display usage information for this script ### scriptHelp -- display usage information for this script
function scriptHelp { function scriptHelp {
echo -e "${bold}${note}\n${scriptName} usage instructions:\n${normal}" echo -e "${bold}${note}\n${scriptName} usage instructions:\n${normal}"
echo -e "${default}This script performs a backup of your NextCloud system" echo -e "${default}This script performs a backup of your Mailcow system"
echo -e "assuming a fairly standard set up such as outlined at" echo -e "assuming a fairly standard set up such as outlined at"
echo -e "${lit}https://mytechiethoughts.com${default}. Full details about" echo -e "${lit}https://mytechiethoughts.com${default}. Full details about"
echo -e "this script can be found at that site." echo -e "this script can be found at that site."
echo -e "${bold}\nThe script performs the following tasks:${normal}${default}" echo -e "${bold}\nThe script performs the following tasks:${normal}${default}"
echo -e "1. Puts NextCloud in maintenance mode." echo -e "1. Stops mailflow (postfix & dovecot) containers."
echo -e "2. Optionally copies a 503 error page to your webroot." echo -e "2. Optionally copies a 503 error page to your webroot."
echo -e "3. Dumps SQL to a temporary directory." echo -e "3. Dumps Mailcow's SQL DB to a temporary directory."
echo -e "4. Invokes borgbackup to backup your SQL info, NextCloud program" echo -e "4. Invokes borgbackup to backup your SQL info, Mailcow settings"
echo -e "\tand data files along with any other files you specify." echo -e "\tand (raw) data files along with any other files you specify."
echo -e "5. Removes temp files, the 503 error page and restores" echo -e "5. Removes temp files, the 503 error page and restores"
echo -e "\tNextCloud to operational status." echo -e "\tMailcow to operational status."
echo -e "\nThe readme file included in this script's git contains detailed" echo -e "\nThe readme file included in this script's git contains detailed"
echo -e "usage information. The following is a brief summary:\n" echo -e "usage information. The following is a brief summary:\n"
echo -e "${bold}${note}Mandatory parameters:${normal}${default}" echo -e "\n${bold}***This script scans for your mailcow configuration file"
echo -e "${lit}\n-d, NextCloud data directory${default}" echo -e "either with the default name or with your provided filename. If"
echo -e "This is the physical location of your NextCloud data." echo -e "multiple files with this name are on your system, the script"
echo -e "${lit}\n-n, NextCloud webroot${default}" echo -e "WILL get confused and exit with errors***${normal}{$default}"
echo -e "This is the location of the actual NextCloud web files (php & html" echo -e "\n${bold}${note}\nOptional parameters:${normal}${default}"
echo -e ",etc.), usually within your NGINX or Apache webroot." echo -e "${lit}\n-1, Timeout for containers to STOP before error${default}"
echo -e "${lit}\n-u, NGINX/Apache webuser account${default}" echo -e "The number of seconds to wait for a docker container to STOP"
echo -e "The webuser account NGINX/Apache (and thus, NextCloud) are running" echo -e "before aborting the procedure and exiting this script with an"
echo -e "under. Some actions must run as this user due to file ownership" echo -e "error."
echo -e "restrictions." echo -e "{info}Default: 120 seconds${default}"
echo -e "${bold}${note}\nOptional parameters:${normal}${default}" echo -e "${lit}\n-2, Timeout for containers to START before error${default}"
echo -e "The number of seconds to wait for a docker container to START"
echo -e "before aborting the procedure and exiting this script with an"
echo -e "error."
echo -e "{info}Default: 180 seconds${default}"
echo -e "${lit}\n-5, Location of 503 error page file${default}" echo -e "${lit}\n-5, Location of 503 error page file${default}"
echo -e "FULL PATH to the 503 error page HTML file you want copied to your" echo -e "FULL PATH to the 503 error page HTML file you want copied to your"
echo -e "webroot to inform users the server is down during the backup. If" echo -e "webroot to inform users the server is down during the backup. If"
@ -57,16 +61,23 @@ function scriptHelp {
echo -e "to connect and process your borg repo. Details on the structure of" echo -e "to connect and process your borg repo. Details on the structure of"
echo -e "this file are in the readme and on ${lit}https://mytechiethoughts.com${default}" 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 "${info}Default: ScriptPath/nc_borg.details${default}"
echo -e "${lit}\n-d, File name of the docker-compose configuration file${default}"
echo -e "Name of the docker-compose configuration file that Mailcow uses"
echo -e "to build/start/stop all containers. This will only be searched"
echo -e "for in the path found to contain your mailcow configuration file."
echo -e "${info}Default: docker-compose.yml${default}"
echo -e "${lit}\n-l, Location to save log file${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 "structured in an way easy for log parsers (like Logwatch) to read."
echo -e "${info}Default: ScriptPath/ScriptName.log${default}" echo -e "${info}Default: ScriptPath/ScriptName.log${default}"
echo -e "${lit}\n-s, Location of file with mySQL details${default}" echo -e "${lit}\n-m, File name of the Mailcow build configuration file${default}"
echo -e "FULL PATH to the plain text file containing all information needed" echo -e "Name of the Mailcow master build configuration file that has all"
echo -e "to connect to your mySQL (mariaDB) server and NextCloud database." echo -e "variables and configuration info unique to your Mailcow setup."
echo -e "Details on the structure of this file are in the readme and on ${lit}" echo -e "This script will search for any file matching what you specify"
echo -e "https://mytechiethoughts.com${default}" echo -e "so please ensure you don't have multiple files laying around with"
echo -e "${info}Default: ScriptPath/nc_sql.details${default}" echo -e "the same name! The path where this file is found is used for all"
echo -e "docker-based operations in this script."
echo -e "${info}Default: mailcow.conf${default}"
echo -e "${lit}\n-v, Verbose output from borgbackup${default}" echo -e "${lit}\n-v, Verbose output from borgbackup${default}"
echo -e "By default, this script will only log summary data from borg." echo -e "By default, this script will only log summary data from borg."
echo -e "If you need/want more detailed information, the verbose setting" echo -e "If you need/want more detailed information, the verbose setting"
@ -795,7 +806,7 @@ echo -e "${bold}${op}${stamp} ***Normal exit process***${normal}" \
>> "$logFile" >> "$logFile"
cleanup cleanup
echo -e "${bold}${ok}${stamp} -- [SUCCESS] All processes completed" \ echo -e "${bold}${ok}${stamp} -- [SUCCESS] All processes completed" \
"successfully --${normal}" >> "$logFile" "successfully --${normal}" >> "$logFile"
quit quit
# This code should not be executed since the 'quit' function should terminate # This code should not be executed since the 'quit' function should terminate