Update: fix always printing sth went wrong
This commit is contained in:
parent
30ccf35d03
commit
e21d579f5f
1 changed files with 10 additions and 1 deletions
|
|
@ -506,7 +506,10 @@ fi
|
||||||
|
|
||||||
|
|
||||||
cleanup() {
|
cleanup() {
|
||||||
|
if [[ "$backup_failed" == true ]]; then
|
||||||
say "Something went wrong"
|
say "Something went wrong"
|
||||||
|
fi
|
||||||
|
|
||||||
say "Ensuring automatic world saves are re-enabled..."
|
say "Ensuring automatic world saves are re-enabled..."
|
||||||
$mcrcon_cmd save-on >/dev/null 2>&1 || true
|
$mcrcon_cmd save-on >/dev/null 2>&1 || true
|
||||||
}
|
}
|
||||||
|
|
@ -522,6 +525,7 @@ say "Initiating backup procedure..."
|
||||||
|
|
||||||
say "Disabling automatic world saves to ensure data consistency..."
|
say "Disabling automatic world saves to ensure data consistency..."
|
||||||
|
|
||||||
|
backup_failed=true
|
||||||
trap cleanup EXIT
|
trap cleanup EXIT
|
||||||
|
|
||||||
$mcrcon_cmd save-off
|
$mcrcon_cmd save-off
|
||||||
|
|
@ -533,11 +537,14 @@ say "Starting incremental snapshot sync. This may take a moment depending on wor
|
||||||
|
|
||||||
if delta_sync_snapshot; then
|
if delta_sync_snapshot; then
|
||||||
say "Snapshot sync completed successfully."
|
say "Snapshot sync completed successfully."
|
||||||
|
|
||||||
else
|
else
|
||||||
say "WARNING: Snapshot sync encountered errors."
|
say "WARNING: Snapshot sync encountered errors."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
say "Renabling automatic world saves..."
|
||||||
|
$mcrcon_cmd save-on
|
||||||
|
|
||||||
say "Backing up Server now "
|
say "Backing up Server now "
|
||||||
|
|
||||||
|
|
@ -560,6 +567,7 @@ if do_backup \
|
||||||
--compression "$COMPRESSION" \
|
--compression "$COMPRESSION" \
|
||||||
--format "$FORMAT"; then
|
--format "$FORMAT"; then
|
||||||
echo "[INFO] Backup finished successfully."
|
echo "[INFO] Backup finished successfully."
|
||||||
|
backup_failed=false
|
||||||
if [[ "$CHECK_USER" == true ]]; then
|
if [[ "$CHECK_USER" == true ]]; then
|
||||||
mark_user_activity_backuped
|
mark_user_activity_backuped
|
||||||
echo "[INFO] User activity marked as backuped."
|
echo "[INFO] User activity marked as backuped."
|
||||||
|
|
@ -570,4 +578,5 @@ else
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
say "Backup ($BACKUP_MODE) completed successfully."
|
say "Backup ($BACKUP_MODE) completed successfully."
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue