rewrote help section

This commit is contained in:
Asif Bacchus 2019-06-19 23:08:07 -06:00
parent 26524c97ed
commit ca190c89bb
1 changed files with 73 additions and 34 deletions

View File

@ -96,40 +96,79 @@ exitError () {
# display script help information # display script help information
scriptHelp () { scriptHelp () {
printf "\n" printf "\n${cyan}%s\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 "Usage:${norm} %s [parameters]\n\n" "$scriptName"
printf "${magenta}Usage:${norm} %s ${cyan}[parameters]${norm}\n\n" \ printf "${cyan}Parameters ${yellow}(default value):${norm}\n"
"$scriptName" printf "There are NO mandatory parameters. If a parameter is not "
printf "${magenta}Parameters (default in brackets):${norm}\n" printf "supplied, it's\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 "default value will be used. In the case of a switch parameter, "
printf "${yellow}script related\n" printf "it will\n"
printf "${cyan}-c, --config, --details (scriptPath/seafbackup.details)\n" printf "remain deactivated if not specified.\n\n"
printf "${norm}Path to the '.details' configuration key/value pair file for this script.\n"
printf "${cyan}-h, -?, --help\n" printf "${magenta}script related\n"
printf "${norm}This help screen.\n" printf "${cyan}-c, --config, --details${norm}\n"
printf "${cyan}-l, --log (scriptPath/scriptName.log)\n" printf "Path to the configuration key/value pair file for this script.\n"
printf "${norm}Path where the log file for this script should be written.\n" printf "${yellow}(scriptPath/seafbackup.details)${norm}\n\n"
printf "${cyan}-v, --verbose (normal output, option is OFF)\n" printf "${cyan}-h, -?, --help${norm}\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 "This help screen.\n\n"
printf "${yellow}503 functionality\n" printf "${cyan}-l, --log${norm}\n"
printf "${cyan}-5, --use-503 (do NOT copy, option is OFF)\n" printf "Path to write log file.\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 "${yellow}(scriptPath/scriptName.log)${norm}\n\n"
printf "${cyan}--503-path (scriptPath/503_backup.html)\n" printf "${cyan}-v, --verbose${norm}\n"
printf "${norm}Path to the file you want copied to your webroot as the 'error 503' page during backup operations.\n" printf "Log borg output with increased verbosity (list all files). "
printf "${cyan}-w, --webroot (/usr/share/nginx/html)\n" printf "Careful! Your\n"
printf "${norm}Path to your webroot or wherever you want the 'error 503' file copied during backups.\n\n" printf "log file can get large very quickly! This is a switch value, "
printf "${yellow}seafile related\n" printf "specifying it\n"
printf "${cyan}-d, --data, --datadir, --seafdata (/var/seafile)\n" printf "will turn the option ON.\n"
printf "${norm}Path to your seafile DATA base/root directory. All your seafile data exists under this path.\n" printf "${yellow}(normal output, option is OFF)${norm}\n\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 "${magenta}503 functionality\n"
printf "${cyan}-p, --seaf, --seafdir (/opt/seafile)\n" printf "${cyan}-5, --use-503${norm}\n"
printf "${norm}Path to your seafile PROGRAM base/root directory. All your seafile configuration and program files exist under this path.\n" printf "Copy an 'error 503' page to your webroot for your webserver to "
printf "${cyan}--seafile-service (seafile.service)\n" printf "find. This is a\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 "switch value, specifying it will instruct the script to copy the "
printf "${cyan}--seahub-service (seahub.service)\n" printf "error page.\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 "${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) # control seafile services (systemd)