From 7d548ce28ea07e5b5e5ebfdbc413cc44871139dd Mon Sep 17 00:00:00 2001 From: Nicolas Chan Date: Sun, 11 Aug 2019 17:55:05 -0700 Subject: [PATCH] Add borg executable bit --- backup-borg.sh | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) mode change 100644 => 100755 backup-borg.sh diff --git a/backup-borg.sh b/backup-borg.sh old mode 100644 new mode 100755 index a29690c..4489bda --- a/backup-borg.sh +++ b/backup-borg.sh @@ -2,6 +2,7 @@ # Minecraft server automatic backup management script # by Nicolas Chan +# https://github.com/nicolaschan/minecraft-backup # MIT License # # For Minecraft servers running in a GNU screen. @@ -133,9 +134,6 @@ message-players-color () { fi } -# Notify players of start -message-players "Starting backup..." "$ARCHIVE_FILE_NAME" - # Parse file timestamp to one readable by "date" parse-file-timestamp () { local DATE_STRING=$(echo $1 | awk -F_ '{gsub(/-/,":",$2); print $1" "$2}') @@ -243,12 +241,18 @@ delete-old-backups () { esac } +# Notify players of start +message-players "Starting backup..." "$ARCHIVE_FILE_NAME" + # Disable world autosaving execute-command "save-off" -# Backup world +# Record start time for performance reporting START_TIME=$(date +"%s") +TMP_WORLD_SAVE_DIR=$(mktemp) +cp -r "$SERVER_WORLD" "$TMP_WORLD_SAVE_DIR" + if $USE_BORG_BACKUP; then borg create --compression "$COMPRESSION_ALGORITHM,$COMPRESSION_LEVEL" "$ARCHIVE_PATH" "$SERVER_WORLD" else