Add world reset system based on world size

This commit is contained in:
mathias 2018-07-05 23:51:43 +03:00
parent b06a3bd9f9
commit b3179cba7f

View file

@ -4,7 +4,12 @@ touch banned-ips.json banned-players.json ops.json usercache.json whitelist.json
echo "$PRIVATE_KEY" > .ssh/id_rsa
chmod 400 $(find . ! -path "*/.*" ! -path "./worlds/world/region/*" -type f)
chmod -R 500 crash-reports/ dumps/ plugins/bStats/ plugins/PluginMetrics/ plugins/ProtocolLib/ plugins/Updater/
rsync -Waqz -e "ssh -o StrictHostKeyChecking=no -T -c aes256-ctr -o Compression=no -x" --exclude-from="bin/excludes" serv@kaboom.pw:sync/ .
if [ "$(ssh -o StrictHostKeyChecking=no -T -c aes256-ctr -o Compression=no -x serv@kaboom.pw 'du -s sync/' | awk '{print $1}')" -gt "500000" ]; then
ssh -o StrictHostKeyChecking=no serv@kaboom.pw 'rm -rf sync/'
else
rsync -Waqz -e "ssh -o StrictHostKeyChecking=no -T -c aes256-ctr -o Compression=no -x" --exclude-from="bin/excludes" serv@kaboom.pw:sync/ .
fi
while true; do
rsync -Waq -e "ssh -o StrictHostKeyChecking=no -T -c aes256-ctr -o Compression=no -x" --exclude-from="bin/excludes" plugins worlds serv@kaboom.pw:sync/ > /dev/null 2>&1