Update backup.sh
Browse files
backup.sh
CHANGED
@@ -8,18 +8,7 @@ pg_dump -U "$DB_POSTGRESDB_USER" -d "$DB_POSTGRESDB_DATABASE" -F c -b -v -f "${W
|
|
8 |
|
9 |
# 检查备份是否成功
|
10 |
if [ $? -eq 0 ]; then
|
11 |
-
echo "
|
12 |
-
|
13 |
-
# 使用 curl 将备份文件上传到 WebDAV,使用基本身份验证
|
14 |
-
curl -T "${WORKDIR}/backups/backup.dump" \
|
15 |
-
--user "${WEBDAV_USER}:${WEBDAV_PASSWORD}" \
|
16 |
-
"${WEBDAV_URL}/backup.dump"
|
17 |
-
|
18 |
-
if [ $? -eq 0 ]; then
|
19 |
-
echo "备份文件成功上传到 WebDAV"
|
20 |
-
else
|
21 |
-
echo "备份文件上传到 WebDAV 失败"
|
22 |
-
fi
|
23 |
else
|
24 |
echo "数据库备份失败"
|
25 |
fi
|
|
|
8 |
|
9 |
# 检查备份是否成功
|
10 |
if [ $? -eq 0 ]; then
|
11 |
+
echo "数据库备份成功"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
else
|
13 |
echo "数据库备份失败"
|
14 |
fi
|