Added backup restore script

This commit is contained in:
Chromachine 2018-10-12 22:42:35 +00:00
parent 25d80f752b
commit c2af8772d6
No known key found for this signature in database
GPG key ID: E3A2A1CAA522AE6E
2 changed files with 50 additions and 1 deletions

View file

@ -352,7 +352,7 @@ users:
name: MC_Brendan
a34194de-b4f1-4bb2-9355-76cd34e3fefb:
options:
name: Hack3rm4n
name: Ikizen
group:
- member
f67bee95-b84f-483d-af00-c6448f742780:
@ -794,3 +794,33 @@ users:
- member
options:
name: mayskam1995
5ac57511-159b-4763-8957-cf1e8cb3b309:
group:
- member
options:
name: DJAronnsaei
acc22974-22ef-4cfd-8fa8-3a20b575b343:
group:
- member
options:
name: Tetdesu
f4ae30a1-2c94-4a0d-87dc-0373a08dba25:
group:
- member
options:
name: Bobbynaut
c917ed19-ce15-4899-94a7-3d7e62ed04a2:
group:
- member
options:
name: Enclasse
21f95712-8b67-498b-8576-56829b95a825:
group:
- member
options:
name: WarpUnresulting
575e3ade-000a-4e89-8ef1-5967b03ec85f:
group:
- member
options:
name: Ivy_Maze

19
Server/restore.sh Executable file
View file

@ -0,0 +1,19 @@
#!/bin/bash
# Only read the error stream from the plugin
echo Make sure to only give the integer part of the coordinates!
echo Also, second coordinate must be larger than the first
: ${5?"I need more!
Usage: $0 <path-to-backup> <coordX1> <coordZ1> <coordX2> <coordZ2>"}
X1=$(($2/256))
Z1=$(($3/256))
X2=$(($4/256))
Z2=$(($5/256))
for X in $(seq $X1 $X2); do
for Z in $(seq $Z1 $Z2); do
echo "Unzipping region ($X,$Z)..." >&2
#unzip "$1" "world/region/r.$X.$Z.mca" -d backupextract
unzip -j -u "$1" "world/region/r.$X.$Z.mca" -d backupextract # BACKUP_world/region # -j: Don't retain folder structure
done
done
echo "Backup restoration finished!" >&2