diff options
author | Reinhard Tartler <siretart@tauware.de> | 2017-06-17 17:53:48 -0400 |
---|---|---|
committer | Reinhard Tartler <siretart@tauware.de> | 2017-06-17 17:55:25 -0400 |
commit | c8c7c2b1d777126fcb36929463d66a8f0a381975 (patch) | |
tree | 6fe5aa5d1687ac8280d0be2ae8ff86ddbcf9fe60 /debian/boxbackup-client.postinst | |
parent | 2afb9130955257a8af5ad8c414c5fba681d4d0f8 (diff) |
Update the notifyadmin.sh script (Closes: #483928)
Diffstat (limited to 'debian/boxbackup-client.postinst')
-rw-r--r-- | debian/boxbackup-client.postinst | 33 |
1 files changed, 24 insertions, 9 deletions
diff --git a/debian/boxbackup-client.postinst b/debian/boxbackup-client.postinst index aa58f3b8..a0bc9a57 100644 --- a/debian/boxbackup-client.postinst +++ b/debian/boxbackup-client.postinst @@ -258,12 +258,25 @@ __EOF cat >>$DEBCONFNOTIFY <<__EOF #!/bin/sh #To reconfigure boxbackup-client run #dpkg-reconfigure boxbackup-client + +# This script is run whenever bbackupd changes state or encounters a +# problem which requires the system administrator to assist: +# +# 1) The store is full, and no more data can be uploaded. +# 2) Some files or directories were not readable. +# 3) A backup run starts or finishes. +# +# The default script emails the system administrator, except for backups +# starting and stopping, where it does nothing. + SUBJECT="BACKUP PROBLEM on host $CLIENTNAME" SENDTO="$MAILTO" -if [ \$1 = store-full ] -then -sendmail \$SENDTO <<EOM +if [ "\$1" = "" ]; then + echo "Usage: \$0 <store-full|read-error|backup-ok|backup-error|backup-start|backup-finish>" >&2 + exit 2 +elif [ "\$1" = store-full ]; then + $sendmail \$SENDTO <<EOM Subject: \$SUBJECT (store full) To: \$SENDTO @@ -277,9 +290,8 @@ FILES ARE NOT BEING BACKED UP Please adjust the limits on account $account_num on server $server. EOM -elif [ \$1 = read-error ] -then -sendmail \$SENDTO <<EOM +elif [ "\$1" = read-error ]; then +$sendmail \$SENDTO <<EOM Subject: \$SUBJECT (read errors) To: \$SENDTO @@ -291,18 +303,21 @@ THESE FILES ARE NOT BEING BACKED UP =================================== Check the logs on $CLIENTNAME for the files and directories which caused -these errors, and take appropraite action. +these errors, and take appropriate action. Other files are being backed up. EOM +elif [ "\$1" = backup-start -o "\$1" = backup-finish -o "\$1" = backup-ok ]; then + # do nothing by default + true else -sendmail \$SENDTO <<EOM +$sendmail \$SENDTO <<EOM Subject: \$SUBJECT (unknown) To: \$SENDTO -The backup daemon on $CLIENTNAME reported an unknown error. +The backup daemon on $CLIENTNAME reported an unknown error (\$1). ========================== FILES MAY NOT BE BACKED UP |