Cron tweaks

This commit is contained in:
mathias 2018-06-10 14:38:18 +03:00
parent a23aab2963
commit 284f39b1d1
2 changed files with 5 additions and 6 deletions

View file

@ -1,6 +1,5 @@
#!/bin/bash
PID="$(pgrep java)"
kill -9 $PID
killall java
rm -rf plugins/ worlds/
ssh -i .key -o StrictHostKeyChecking=no serv@kaboom.pw 'rm -rf sync/'

View file

@ -1,10 +1,10 @@
#!/bin/bash
mkdir -p crash-reports/ dumps/
touch banned-ips.json banned-ips.json.backup banned-players.json banned-players.json.backup ops.json ops.json.backup usercache.json whitelist.json whitelist.json.backup
echo "$PRIVATE_KEY" > .key
echo "$PRIVATE_KEY" > .ssh/id_rsa
chmod -R 500 crash-reports/ dumps/ plugins/bStats/ plugins/PluginMetrics/ plugins/ProtocolLib/ plugins/Updater/
chmod 400 'find . -type f'
rsync -Waqz -e "ssh -i .key -o StrictHostKeyChecking=no -T -c aes256-ctr -o Compression=no -x" --exclude-from="bin/excludes" serv@kaboom.pw:sync/ .
rsync -Waqz -e "ssh -o StrictHostKeyChecking=no -T -c aes256-ctr -o Compression=no -x" --exclude-from="bin/excludes" serv@kaboom.pw:sync/ .
if [ ! -d worlds/ ]; then
cp -r reset/worlds/ .
@ -14,12 +14,12 @@ else
fi
while true; do
rsync -Waq -e "ssh -i .key -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
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
sleep 5
done &
while true; do
ssh -i .key -o StrictHostKeyChecking=no -o ServerAliveInterval=30 -o ServerAliveCountMax=9999 -S none -N -T -R 64518:localhost:25565 serv@kaboom.pw > /dev/null 2>&1
ssh -o StrictHostKeyChecking=no -o ServerAliveInterval=30 -o ServerAliveCountMax=9999 -S none -N -T -R 64518:localhost:25565 serv@kaboom.pw > /dev/null 2>&1
sleep 1
done &