func scriptHelp and contents

This commit is contained in:
Asif Bacchus 2019-06-19 02:13:21 -06:00
parent 85fe709e06
commit 26524c97ed
1 changed files with 38 additions and 0 deletions

View File

@ -94,6 +94,44 @@ exitError () {
exit "$1"
}
# 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"
}
# control seafile services (systemd)
seafSvc () {
if [ "$1" = "start" ]; then