diff options
author | TheMightyV <themightyv@protonmail.com> | 2022-01-04 22:41:10 +0100 |
---|---|---|
committer | TheMightyV <themightyv@protonmail.com> | 2022-01-04 22:41:10 +0100 |
commit | cba2d63889fa3ae640d213ab2c15f99d3d941967 (patch) | |
tree | d1fe7b5b2dcd183ada011e86c850c0329ad5ccf0 /server.sh | |
parent | c94132808d2a3499f19f86424bfdedf9e0c39312 (diff) | |
download | minecraft-server-tools-cba2d63889fa3ae640d213ab2c15f99d3d941967.tar.gz |
optional password protection of borg repo
fixed borg backup check
added nanoseconds to old world backup to prevent collision during tests
Diffstat (limited to 'server.sh')
-rwxr-xr-x | server.sh | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -140,6 +140,9 @@ function init_backup() { function same_world() { delta=$(diff -r "$1" "$2") + if [ $? -ne 0 ]; then + return 1 + fi if [ -z "$delta" ] ; then return 0 fi @@ -366,8 +369,8 @@ function server_restore() { local oldworld_name if [ "$dest" = "$PWD" ] && [[ -d "$WORLD_NAME" ]]; then echo -n "Preserving old world: " - oldworld_name="${WORLD_NAME}.old.$(date +'%F_%H-%M-%S')" - mv -v "$PWD/$WORLD_NAME" "$PWD/$oldworld_name" + oldworld_name="${WORLD_NAME}.old.$(date +'%F_%H-%M-%S.%N')" + mv -n -v "$PWD/$WORLD_NAME" "$PWD/$oldworld_name" fi @@ -389,7 +392,7 @@ function server_restore() { return 1 fi - echo "Snapshot restored" + echo_debug "Snapshot restored" return 0 } |