diff --git a/check_clientbackup b/check_clientbackup index 6a323a2a0dc068c9123f1b9b00a632529981091d..924c384c66033b94e098e59ac1ac165913987fce 100755 --- a/check_clientbackup +++ b/check_clientbackup @@ -16,16 +16,60 @@ # 2022-08-10 v1.9 <axel.hahn@iml.unibe.ch> FIX: mask the dot in .log # 2022-10-21 v1.10 <axel.hahn@unibe.ch> remove grep: warning: stray \ before white space # show last backup, prune, verify +# 2023-06-22 v1.11 <axel.hahn@unibe.ch> add help and param support; add parameter for install directory # ====================================================================== . $( dirname $0 )/inc_pluginfunctions +self_APPNAME=$( basename $0 | tr [:lower:] [:upper:] ) +self_APPVERSION=1.11 + sInstalldir=/opt/imlbackup/client/ -sChecker=$sInstalldir/check_clientbackup.sh +# ---------------------------------------------------------------------- +# FUNCTIONS +# ---------------------------------------------------------------------- + +function showHelp(){ + _self=$(basename $0) +cat <<EOF +______________________________________________________________________ + +$self_APPNAME +v$self_APPVERSION + +(c) Institute for Medical Education - University of Bern +Licence: GNU GPL 3 +______________________________________________________________________ + +Show status of IML backup. + +SYNTAX: +$_self [-d DIRECTORY] + +OPTIONS: + -h or --help show this help. + -d or --dir set installation dir of iml backup to find its check skript + default: /opt/imlbackup/client/ + +EXAMPLE: +$_self -d /home/backup/imlbackup + set a custom directory und run the backup check + +EOF +} + +# --- check param -h +while [[ "$#" -gt 0 ]]; do case $1 in + -h|--help) showHelp; exit 0;; + -d|--dir) sInstalldir=$2; shift ;shift;; + *) echo "ERROR: Unknown parameter: $1"; showHelp; exit 1; +esac; done + +sChecker=$sInstalldir/check_clientbackup.sh if [ ! -x $sChecker ]; then - ph.abort "$sChecker not found - maybe clientbackup is not installed." + ph.abort "$sChecker not found - maybe clientbackup is not installed here. Use param -d to set the install directory." fi result=$( $sChecker )