reformatted help text

This commit is contained in:
Asif Bacchus 2019-05-18 20:14:29 -06:00
parent 9e812b5471
commit 1cc5f8fb00

98
backup.sh Normal file → Executable file
View File

@ -19,67 +19,83 @@ note="\e[95m"
### 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 Seafile system" echo -e "${default}This script performs a backup of your Seafile system" \
echo -e "assuming a fairly standard baremetal set up such as outlined at" "assuming a fairly standard"
echo -e "${lit}https://mytechiethoughts.com${default}. Full details about" echo -e "baremetal set up such as outlined at${lit}" \
echo -e "this script can be found at that site." "https://mytechiethoughts.com${default}."
echo -e "Details about this script can be found at that site."
echo -e "${bold}\nThe script performs the following tasks:" \ echo -e "${bold}\nThe script performs the following tasks:" \
"${normal}${default}" "${normal}${default}"
echo -e "1. Stops Seafile services and copies a 503 error page to" \ echo -e "1. Stops Seafile services and copies a 503 error page to" \
"your webroot" "your webroot to"
echo -e "\tto prevent access during backup." echo -e "\tprevent access to Seafile during the backup."
echo -e "2. Dumps SQL to a temporary directory." echo -e "2. Dumps Seafile SQL database to a temporary directory."
echo -e "3. Invokes borgbackup to backup your SQL info, Seafile program" echo -e "3. Invokes borgbackup to backup your SQL data, Seafile program" \
echo -e "and data files" "and data files,"
echo -e "\talong with any other files you specify." echo -e "\tand any other files you specify."
echo -e "3. Prunes old backups from borgbackup repo." echo -e "3. Prunes old backups from borgbackup repo."
echo -e "4. Removes 503 page and cleans up." echo -e "4. Removes 503 error page, if necessary, and cleans up."
echo -e "\nThe readme file included in this script's git contains detailed" echo -e "\nThe readme file included in this script's git repo contains" \
echo -e "usage information. The following is a brief summary:\n" "detailed usage"
echo -e "information. The following is a brief summary:\n"
echo -e "${bold}${note}Mandatory parameters:${normal}${default}" echo -e "${bold}${note}Mandatory parameters:${normal}${default}"
echo -e "${lit}\n-d, Seafile data directory${default}" echo -e "${lit}\n-d, Seafile data directory${default}"
echo -e "This is the physical location of your Seafile data." echo -e "This is the physical location of your Seafile data."
echo -e "${lit}\n-u, Seafile system user account${default}" echo -e "${lit}\n-u, Seafile system user account${default}"
echo -e "The system account Seafile is running under. Some actions must" echo -e "The system account Seafile is running under. Some actions must" \
echo -e "run as this user due to file ownership restrictions." "run as this"
echo -e "user due to file ownership restrictions."
echo -e "${bold}${note}\nOptional parameters:${normal}${default}" echo -e "${bold}${note}\nOptional parameters:${normal}${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" \
echo -e "webroot to inform users the server is down during the backup. If" "your webroot to"
echo -e "you don't specify a path/file, the default will be used. If the" echo -e "inform users the server is down during the backup. If you don't" \
echo -e "default cannot be found, a warning will be logged and the script" "specify a path/"
echo -e "will continue." echo -e "file, the default will be used. If the default cannot be found," \
"a warning will"
echo -e "be logged and the script will continue."
echo -e "${info}Default: ScriptPath/503.html${default}" echo -e "${info}Default: ScriptPath/503.html${default}"
echo -e "${lit}\n-b, Location of file with borg repo details${default}" echo -e "${lit}\n-b, Location of file with borg repo details${default}"
echo -e "FULL PATH to the plain text file containing all information needed" echo -e "FULL PATH to the plain text file containing all information" \
echo -e "to connect and process your borg repo. Details on the structure of" "needed to connect"
echo -e "this file are in the readme and on ${lit}https://mytechiethoughts.com${default}" echo -e "and process your borg repo. Details on the structure of this" \
"file are in the"
echo -e "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-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" \
echo -e "structured in an way easy for log parsers (like Logwatch) to read." "is structured in"
echo -e "a 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-s, Location of file with mySQL details${default}"
echo -e "FULL PATH to the plain text file containing all information needed" echo -e "FULL PATH to the plain text file containing all information" \
echo -e "to connect to your mySQL (mariaDB) server and Seafile database." "needed to connect"
echo -e "Details on the structure of this file are in the readme and on" echo -e "to your mySQL (mariaDB) server and Seafile database. Details" \
echo -e "${lit}https://mytechiethoughts.com${default}" "on the structure"
echo -e "of this file are in the readme and on${lit}" \
"https://mytechiethoughts.com${default}"
echo -e "${info}Default: ScriptPath/nc_sql.details${default}" echo -e "${info}Default: ScriptPath/nc_sql.details${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" "If you need/want"
echo -e "will list every file processed along with their status. Note: Your" echo -e "more detailed information, the verbose setting will list every" \
echo -e "log file can quickly get very very large using this option!" "file processed"
echo -e "along with their status. Note: Your log file can quickly get" \
"very very large"
echo -e "using this option!"
echo -e "${info}Default: NOT activated (standard logging)${default}" echo -e "${info}Default: NOT activated (standard logging)${default}"
echo -e "${lit}\n-w, webserver's webroot directory${default}" echo -e "${lit}\n-w, webserver's webroot directory${default}"
echo -e "This is the location from which your webserver (NGINX, Apache," echo -e "This is the location from which your webserver (NGINX, Apache," \
echo -e "etc.) physically stores files to be served. This is NOT the" "etc.) physically"
echo -e "configuration directory for your webserver! It is the place" echo -e "stores files to be served. This is NOT the configuration" \
echo -e "where the actual HTML/PHP/CSS/JS/etc. files are stored." "directory for your"
echo -e "NOTE: If you omit this option, then the entire 503 copy process" echo -e "webserver! It is the place where the actual" \
echo -e "will be skipped regardless of the presence of a 503.html file." "HTML/PHP/CSS/JS/etc. files are"
echo -e "If you don't want to use the 503 feature, omitting this is an easy" echo -e "stored. NOTE: If you omit this option, then the entire 503 copy" \
echo -e "way to skip it!" "process will"
echo -e "be skipped regardless of the presence of a 503.html file. If" \
"you don't want to"
echo -e "use the 503 feature, omitting this is an easy way to skip it!"
echo -e "${info}Default: NONE${default}" echo -e "${info}Default: NONE${default}"
echo -e "${lit}\n-?, This help screen${default}\n" echo -e "${lit}\n-?, This help screen${default}\n"
echo -e "${bold}Please refer to the readme file and/or ${lit}https://mytechiethoughts.com${default}" echo -e "${bold}Please refer to the readme file and/or ${lit}https://mytechiethoughts.com${default}"