rewrote help section

This commit is contained in:
Asif Bacchus 2019-06-19 23:08:07 -06:00
parent 26524c97ed
commit ca190c89bb

View File

@ -96,40 +96,79 @@ exitError () {
# display script help information
scriptHelp () {
printf "\n"
printf "${magenta}%s usage instructions:${norm}\n\n" "$scriptName"
printf "This script performs a backup of your Seafile system assuming a fairly standard set up as per the documentation. Full details about this script can be found in the repo wiki at ${yellow}https://git.asifbacchus.app/asif/seafileBackup/wiki${norm}\n\n"
printf "${magenta}Usage:${norm} %s ${cyan}[parameters]${norm}\n\n" \
"$scriptName"
printf "${magenta}Parameters (default in brackets):${norm}\n"
printf "There are NO mandatory parameters. If a parameter is not supplied, it's default value will be used. In the case of a switch parameter, it will be remain deactivated if not specified.\n\n"
printf "${yellow}script related\n"
printf "${cyan}-c, --config, --details (scriptPath/seafbackup.details)\n"
printf "${norm}Path to the '.details' configuration key/value pair file for this script.\n"
printf "${cyan}-h, -?, --help\n"
printf "${norm}This help screen.\n"
printf "${cyan}-l, --log (scriptPath/scriptName.log)\n"
printf "${norm}Path where the log file for this script should be written.\n"
printf "${cyan}-v, --verbose (normal output, option is OFF)\n"
printf "${norm}Log borg output with increased verbosity including listing EVERY file processed. Use this sparingly since your log file can get very large, very quickly! This is a switch value, specifying it will turn the option ON.\n\n"
printf "${yellow}503 functionality\n"
printf "${cyan}-5, --use-503 (do NOT copy, option is OFF)\n"
printf "${norm}Copy an 'error 503' page to your webroot. Your webserver can then scan for that file and display it (details in wiki for how to set that up). This is a switch value, specifying it will instruct the script to copy the error page.\n"
printf "${cyan}--503-path (scriptPath/503_backup.html)\n"
printf "${norm}Path to the file you want copied to your webroot as the 'error 503' page during backup operations.\n"
printf "${cyan}-w, --webroot (/usr/share/nginx/html)\n"
printf "${norm}Path to your webroot or wherever you want the 'error 503' file copied during backups.\n\n"
printf "${yellow}seafile related\n"
printf "${cyan}-d, --data, --datadir, --seafdata (/var/seafile)\n"
printf "${norm}Path to your seafile DATA base/root directory. All your seafile data exists under this path.\n"
printf "${cyan}-o, --offline (leave seafile running, OFF)\n"
printf "${norm}If you want this script to stop your seafile systemd services and start them up again after the backup, then specify this option. This is a switch value.\n"
printf "${cyan}-p, --seaf, --seafdir (/opt/seafile)\n"
printf "${norm}Path to your seafile PROGRAM base/root directory. All your seafile configuration and program files exist under this path.\n"
printf "${cyan}--seafile-service (seafile.service)\n"
printf "${norm}The name of your seafile systemd service. Only needed if you want the script to perform an offline backup and you are not using the default service name.\n"
printf "${cyan}--seahub-service (seahub.service)\n"
printf "${norm}The name of your seahub (web) systemd service. Only needed if you want the script to perform an offline backup and you are not using the default service name.\n\n"
printf "\n${cyan}%s\n" "--------------------------------------------------------------------------------"
printf "Usage:${norm} %s [parameters]\n\n" "$scriptName"
printf "${cyan}Parameters ${yellow}(default value):${norm}\n"
printf "There are NO mandatory parameters. If a parameter is not "
printf "supplied, it's\n"
printf "default value will be used. In the case of a switch parameter, "
printf "it will\n"
printf "remain deactivated if not specified.\n\n"
printf "${magenta}script related\n"
printf "${cyan}-c, --config, --details${norm}\n"
printf "Path to the configuration key/value pair file for this script.\n"
printf "${yellow}(scriptPath/seafbackup.details)${norm}\n\n"
printf "${cyan}-h, -?, --help${norm}\n"
printf "This help screen.\n\n"
printf "${cyan}-l, --log${norm}\n"
printf "Path to write log file.\n"
printf "${yellow}(scriptPath/scriptName.log)${norm}\n\n"
printf "${cyan}-v, --verbose${norm}\n"
printf "Log borg output with increased verbosity (list all files). "
printf "Careful! Your\n"
printf "log file can get large very quickly! This is a switch value, "
printf "specifying it\n"
printf "will turn the option ON.\n"
printf "${yellow}(normal output, option is OFF)${norm}\n\n"
printf "${magenta}503 functionality\n"
printf "${cyan}-5, --use-503${norm}\n"
printf "Copy an 'error 503' page to your webroot for your webserver to "
printf "find. This is a\n"
printf "switch value, specifying it will instruct the script to copy the "
printf "error page.\n"
printf "${yellow}(do NOT copy, option is OFF)${norm}\n\n"
printf "${cyan}--503-path${norm}\n"
printf "Path to the file you want copied to your webroot as the 'error "
printf "503' page during\n"
printf "backup operations.\n"
printf "${yellow}(scriptPath/503_backup.html)${norm}\n\n"
printf "${cyan}-w, --webroot${norm}\n"
printf "Path to where the 'error 503' file should be copied during "
printf "backups.\n"
printf "${yellow}(/usr/share/nginx/html)${norm}\n\n"
printf "${magenta}seafile related\n"
printf "${cyan}-d, --data, --datadir, --seafdata${norm}\n"
printf "Path to your seafile DATA base/root directory."
printf "${yellow}(/var/seafile)${norm}\n\n"
printf "${cyan}-o, --offline${norm}\n"
printf "Stop your seafile systemd services and start them up again after "
printf "the backup.\n"
printf "This is a switch value.\n"
printf "${yellow}(leave seafile running, OFF)${norm}\n\n"
printf "${cyan}-p, --seaf, --seafdir${norm}\n"
printf "${norm}Path to your seafile PROGRAM base/root directory.\n"
printf "${yellow}(/opt/seafile)${norm}\n\n"
printf "${cyan}--seafile-service${norm}\n"
printf "The name of your seafile systemd service. Use with '--offline' "
printf "when using a\n"
printf "non-default service name.\n"
printf "${yellow}(seafile.service)${norm}\n\n"
printf "${cyan}--seahub-service${norm}\n"
printf "The name of your seahub (web) systemd service. Use with "
printf "'--offline' when using\n"
printf "a non-default service name.\n"
printf "${yellow}(seahub.service)${norm}\n\n"
printf "More details and examples of script usage can be found in the "
printf "repo wiki at\n"
printf "${yellow}https://git.asifbacchus.app/asif/seafileBackup.git"
printf "/wiki${norm}.\n"
printf "${cyan}%s${norm}\n\n" "--------------------------------------------------------------------------------"
}
# control seafile services (systemd)