feat: replace PING_URL_WHEN_ERROR with PING_URL_WHEN_FAILURE
This commit is contained in:
1 parent
80b542acec
commit
1497b0f020
6 files changed
+19
-19
No files matched your search
@@ -13,7 +13,7 @@
|
||||
# PING_URL=""
|
||||
# PING_URL_WHEN_STARTS=""
|
||||
# PING_URL_WHEN_SUCCESS=""
|
||||
# PING_URL_WHEN_ERROR=""
|
||||
# PING_URL_WHEN_FAILURE=""
|
||||
# MAIL_SMTP_ENABLE="FALSE"
|
||||
# MAIL_SMTP_VARIABLES=""
|
||||
# MAIL_TO=""
|
||||
|
||||
@@ -56,7 +56,7 @@ And the following ways of notifying backup results are supported.
|
||||
### Configure Rclone (⚠️ MUST READ ⚠️)
|
||||
|
||||
> **For backup, you need to configure Rclone first, otherwise the backup tool will not work.**
|
||||
>
|
||||
>
|
||||
> **For restore, it is not necessary.**
|
||||
|
||||
We upload the backup files to the storage system by [Rclone](https://rclone.org/).
|
||||
@@ -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.
|
||||
|
||||
#### 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**.
|
||||
|
||||
|
||||
+3
-3
@@ -56,7 +56,7 @@
|
||||
### 配置 Rclone (⚠️ 必读 ⚠️)
|
||||
|
||||
> **对于备份,你需要先配置 Rclone,否则备份工具不会工作。**
|
||||
>
|
||||
>
|
||||
> **对于还原,它不是必要的。**
|
||||
|
||||
我们通过 [Rclone](https://rclone.org/) 同步备份文件到远程存储系统。
|
||||
@@ -338,7 +338,7 @@ Rclone 全局参数,详见 [flags](https://rclone.org/flags/)。
|
||||
|
||||
使用 [healthcheck.io](https://healthchecks.io/) 地址或者其他类似的 cron 监控,以便在备份**成功**后执行 `GET` 请求。
|
||||
|
||||
#### PING_URL_WHEN_ERROR
|
||||
#### PING_URL_WHEN_FAILURE
|
||||
|
||||
使用 [healthcheck.io](https://healthchecks.io/) 地址或者其他类似的 cron 监控,以便在备份**失败**后执行 `GET` 请求。
|
||||
|
||||
@@ -403,7 +403,7 @@ Rclone 全局参数,详见 [flags](https://rclone.org/flags/)。
|
||||
|
||||
#### BACKUP_FILE_DATE
|
||||
|
||||
你应该使用 [`BACKUP_FILE_SUFFIX`](#backup_file_suffix) 环境变量替代。
|
||||
你应该使用 [`BACKUP_FILE_SUFFIX`](#backup_file_suffix) 环境变量替代。
|
||||
|
||||
只有在你确定想修改备份文件的时间前缀(如 20220101)时编辑该环境变量。**错误的配置可能导致备份文件被错误的覆盖。**
|
||||
|
||||
|
||||
+4
-4
@@ -26,10 +26,10 @@ services:
|
||||
# ZIP_TYPE: 'zip'
|
||||
# BACKUP_FILE_SUFFIX: '%Y%m%d'
|
||||
# BACKUP_KEEP_DAYS: 0
|
||||
# PING_URL=''
|
||||
# PING_URL_WHEN_STARTS=''
|
||||
# PING_URL_WHEN_SUCCESS=''
|
||||
# PING_URL_WHEN_ERROR=''
|
||||
# PING_URL: ''
|
||||
# PING_URL_WHEN_STARTS: ''
|
||||
# PING_URL_WHEN_SUCCESS: ''
|
||||
# PING_URL_WHEN_FAILURE: ''
|
||||
# MAIL_SMTP_ENABLE: 'FALSE'
|
||||
# MAIL_SMTP_VARIABLES: ''
|
||||
# MAIL_TO: ''
|
||||
|
||||
+4
-4
@@ -43,7 +43,7 @@ function backup_db_postgresql() {
|
||||
if [[ $? != 0 ]]; then
|
||||
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_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
|
||||
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_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
|
||||
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_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
|
||||
|
||||
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_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
|
||||
color yellow "PING_URL_WHEN_SUCCESS: ${PING_URL_WHEN_SUCCESS}"
|
||||
fi
|
||||
if [[ -n "${PING_URL_WHEN_ERROR}" ]]; then
|
||||
color yellow "PING_URL_WHEN_ERROR: ${PING_URL_WHEN_ERROR}"
|
||||
if [[ -n "${PING_URL_WHEN_FAILURE}" ]]; then
|
||||
color yellow "PING_URL_WHEN_FAILURE: ${PING_URL_WHEN_FAILURE}"
|
||||
fi
|
||||
color yellow "MAIL_SMTP_ENABLE: ${MAIL_SMTP_ENABLE}"
|
||||
if [[ "${MAIL_SMTP_ENABLE}" == "TRUE" ]]; then
|
||||
@@ -460,9 +460,9 @@ function init_env_ping() {
|
||||
get_env PING_URL_WHEN_SUCCESS
|
||||
PING_URL_WHEN_SUCCESS="${PING_URL_WHEN_SUCCESS:-""}"
|
||||
|
||||
# PING_URL_WHEN_ERROR
|
||||
get_env PING_URL_WHEN_ERROR
|
||||
PING_URL_WHEN_ERROR="${PING_URL_WHEN_ERROR:-""}"
|
||||
# PING_URL_WHEN_FAILURE
|
||||
get_env PING_URL_WHEN_FAILURE
|
||||
PING_URL_WHEN_FAILURE="${PING_URL_WHEN_FAILURE:-""}"
|
||||
}
|
||||
|
||||
function init_env_mail() {
|
||||
|
||||
Reference in new issue
Block a user