feat: replace PING_URL_WHEN_ERROR with PING_URL_WHEN_FAILURE
This commit is contained in:
1 parent
80b542acec
commit
1497b0f020
6 files changed
+16
-16
No files matched your search
@@ -13,7 +13,7 @@
|
|||||||
# PING_URL=""
|
# PING_URL=""
|
||||||
# PING_URL_WHEN_STARTS=""
|
# PING_URL_WHEN_STARTS=""
|
||||||
# PING_URL_WHEN_SUCCESS=""
|
# PING_URL_WHEN_SUCCESS=""
|
||||||
# PING_URL_WHEN_ERROR=""
|
# PING_URL_WHEN_FAILURE=""
|
||||||
# MAIL_SMTP_ENABLE="FALSE"
|
# MAIL_SMTP_ENABLE="FALSE"
|
||||||
# MAIL_SMTP_VARIABLES=""
|
# MAIL_SMTP_VARIABLES=""
|
||||||
# MAIL_TO=""
|
# MAIL_TO=""
|
||||||
|
|||||||
@@ -340,7 +340,7 @@ Use [healthcheck.io](https://healthchecks.io/) url or similar cron monitoring to
|
|||||||
|
|
||||||
Use [healthcheck.io](https://healthchecks.io/) url or similar cron monitoring to perform `GET` requests after a **successful** backup.
|
Use [healthcheck.io](https://healthchecks.io/) url or similar cron monitoring to perform `GET` requests after a **successful** backup.
|
||||||
|
|
||||||
#### PING_URL_WHEN_ERROR
|
#### PING_URL_WHEN_FAILURE
|
||||||
|
|
||||||
Use [healthcheck.io](https://healthchecks.io/) url or similar cron monitoring to perform `GET` requests after a backup **fails**.
|
Use [healthcheck.io](https://healthchecks.io/) url or similar cron monitoring to perform `GET` requests after a backup **fails**.
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -338,7 +338,7 @@ Rclone 全局参数,详见 [flags](https://rclone.org/flags/)。
|
|||||||
|
|
||||||
使用 [healthcheck.io](https://healthchecks.io/) 地址或者其他类似的 cron 监控,以便在备份**成功**后执行 `GET` 请求。
|
使用 [healthcheck.io](https://healthchecks.io/) 地址或者其他类似的 cron 监控,以便在备份**成功**后执行 `GET` 请求。
|
||||||
|
|
||||||
#### PING_URL_WHEN_ERROR
|
#### PING_URL_WHEN_FAILURE
|
||||||
|
|
||||||
使用 [healthcheck.io](https://healthchecks.io/) 地址或者其他类似的 cron 监控,以便在备份**失败**后执行 `GET` 请求。
|
使用 [healthcheck.io](https://healthchecks.io/) 地址或者其他类似的 cron 监控,以便在备份**失败**后执行 `GET` 请求。
|
||||||
|
|
||||||
|
|||||||
+4
-4
@@ -26,10 +26,10 @@ services:
|
|||||||
# ZIP_TYPE: 'zip'
|
# ZIP_TYPE: 'zip'
|
||||||
# BACKUP_FILE_SUFFIX: '%Y%m%d'
|
# BACKUP_FILE_SUFFIX: '%Y%m%d'
|
||||||
# BACKUP_KEEP_DAYS: 0
|
# BACKUP_KEEP_DAYS: 0
|
||||||
# PING_URL=''
|
# PING_URL: ''
|
||||||
# PING_URL_WHEN_STARTS=''
|
# PING_URL_WHEN_STARTS: ''
|
||||||
# PING_URL_WHEN_SUCCESS=''
|
# PING_URL_WHEN_SUCCESS: ''
|
||||||
# PING_URL_WHEN_ERROR=''
|
# PING_URL_WHEN_FAILURE: ''
|
||||||
# MAIL_SMTP_ENABLE: 'FALSE'
|
# MAIL_SMTP_ENABLE: 'FALSE'
|
||||||
# MAIL_SMTP_VARIABLES: ''
|
# MAIL_SMTP_VARIABLES: ''
|
||||||
# MAIL_TO: ''
|
# MAIL_TO: ''
|
||||||
|
|||||||
+4
-4
@@ -43,7 +43,7 @@ function backup_db_postgresql() {
|
|||||||
if [[ $? != 0 ]]; then
|
if [[ $? != 0 ]]; then
|
||||||
color red "backup vaultwarden postgresql database failed"
|
color red "backup vaultwarden postgresql database failed"
|
||||||
|
|
||||||
send_ping "${PING_URL_WHEN_ERROR}" "error"
|
send_ping "${PING_URL_WHEN_FAILURE}" "failure"
|
||||||
send_ping "${PING_URL}" "completion"
|
send_ping "${PING_URL}" "completion"
|
||||||
send_mail_content "FALSE" "Backup failed at $(date +"%Y-%m-%d %H:%M:%S %Z"). Reason: Backup postgresql database failed."
|
send_mail_content "FALSE" "Backup failed at $(date +"%Y-%m-%d %H:%M:%S %Z"). Reason: Backup postgresql database failed."
|
||||||
|
|
||||||
@@ -58,7 +58,7 @@ function backup_db_mysql() {
|
|||||||
if [[ $? != 0 ]]; then
|
if [[ $? != 0 ]]; then
|
||||||
color red "backup vaultwarden mysql database failed"
|
color red "backup vaultwarden mysql database failed"
|
||||||
|
|
||||||
send_ping "${PING_URL_WHEN_ERROR}" "error"
|
send_ping "${PING_URL_WHEN_FAILURE}" "failure"
|
||||||
send_ping "${PING_URL}" "completion"
|
send_ping "${PING_URL}" "completion"
|
||||||
send_mail_content "FALSE" "Backup failed at $(date +"%Y-%m-%d %H:%M:%S %Z"). Reason: Backup mysql database failed."
|
send_mail_content "FALSE" "Backup failed at $(date +"%Y-%m-%d %H:%M:%S %Z"). Reason: Backup mysql database failed."
|
||||||
|
|
||||||
@@ -167,7 +167,7 @@ function upload() {
|
|||||||
if [[ ! -e "${UPLOAD_FILE}" ]]; then
|
if [[ ! -e "${UPLOAD_FILE}" ]]; then
|
||||||
color red "upload file not found"
|
color red "upload file not found"
|
||||||
|
|
||||||
send_ping "${PING_URL_WHEN_ERROR}" "error"
|
send_ping "${PING_URL_WHEN_FAILURE}" "failure"
|
||||||
send_ping "${PING_URL}" "completion"
|
send_ping "${PING_URL}" "completion"
|
||||||
send_mail_content "FALSE" "File upload failed at $(date +"%Y-%m-%d %H:%M:%S %Z"). Reason: Upload file not found."
|
send_mail_content "FALSE" "File upload failed at $(date +"%Y-%m-%d %H:%M:%S %Z"). Reason: Upload file not found."
|
||||||
|
|
||||||
@@ -190,7 +190,7 @@ function upload() {
|
|||||||
done
|
done
|
||||||
|
|
||||||
if [[ "${HAS_ERROR}" == "TRUE" ]]; then
|
if [[ "${HAS_ERROR}" == "TRUE" ]]; then
|
||||||
send_ping "${PING_URL_WHEN_ERROR}" "error"
|
send_ping "${PING_URL_WHEN_FAILURE}" "failure"
|
||||||
send_ping "${PING_URL}" "completion"
|
send_ping "${PING_URL}" "completion"
|
||||||
send_mail_content "FALSE" "File upload failed at $(date +"%Y-%m-%d %H:%M:%S %Z")."
|
send_mail_content "FALSE" "File upload failed at $(date +"%Y-%m-%d %H:%M:%S %Z")."
|
||||||
|
|
||||||
|
|||||||
+5
-5
@@ -353,8 +353,8 @@ function init_env() {
|
|||||||
if [[ -n "${PING_URL_WHEN_SUCCESS}" ]]; then
|
if [[ -n "${PING_URL_WHEN_SUCCESS}" ]]; then
|
||||||
color yellow "PING_URL_WHEN_SUCCESS: ${PING_URL_WHEN_SUCCESS}"
|
color yellow "PING_URL_WHEN_SUCCESS: ${PING_URL_WHEN_SUCCESS}"
|
||||||
fi
|
fi
|
||||||
if [[ -n "${PING_URL_WHEN_ERROR}" ]]; then
|
if [[ -n "${PING_URL_WHEN_FAILURE}" ]]; then
|
||||||
color yellow "PING_URL_WHEN_ERROR: ${PING_URL_WHEN_ERROR}"
|
color yellow "PING_URL_WHEN_FAILURE: ${PING_URL_WHEN_FAILURE}"
|
||||||
fi
|
fi
|
||||||
color yellow "MAIL_SMTP_ENABLE: ${MAIL_SMTP_ENABLE}"
|
color yellow "MAIL_SMTP_ENABLE: ${MAIL_SMTP_ENABLE}"
|
||||||
if [[ "${MAIL_SMTP_ENABLE}" == "TRUE" ]]; then
|
if [[ "${MAIL_SMTP_ENABLE}" == "TRUE" ]]; then
|
||||||
@@ -460,9 +460,9 @@ function init_env_ping() {
|
|||||||
get_env PING_URL_WHEN_SUCCESS
|
get_env PING_URL_WHEN_SUCCESS
|
||||||
PING_URL_WHEN_SUCCESS="${PING_URL_WHEN_SUCCESS:-""}"
|
PING_URL_WHEN_SUCCESS="${PING_URL_WHEN_SUCCESS:-""}"
|
||||||
|
|
||||||
# PING_URL_WHEN_ERROR
|
# PING_URL_WHEN_FAILURE
|
||||||
get_env PING_URL_WHEN_ERROR
|
get_env PING_URL_WHEN_FAILURE
|
||||||
PING_URL_WHEN_ERROR="${PING_URL_WHEN_ERROR:-""}"
|
PING_URL_WHEN_FAILURE="${PING_URL_WHEN_FAILURE:-""}"
|
||||||
}
|
}
|
||||||
|
|
||||||
function init_env_mail() {
|
function init_env_mail() {
|
||||||
|
|||||||
Reference in new issue
Block a user