From 8869ce5ff1ad3e222b99537e4f936daf07b2da57 Mon Sep 17 00:00:00 2001 From: mathias Date: Fri, 6 Jul 2018 00:33:37 +0300 Subject: [PATCH] Exclude schematics from deletion --- bin/start | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/bin/start b/bin/start index 3649843..8c3346d 100755 --- a/bin/start +++ b/bin/start @@ -5,11 +5,10 @@ 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/ -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/ . +if [ "$(ssh -o StrictHostKeyChecking=no -T -c aes256-ctr -o Compression=no -x serv@kaboom.pw 'du -s sync/worlds/' | awk '{print $1}')" -gt "500000" ]; then + ssh -o StrictHostKeyChecking=no serv@kaboom.pw 'cd sync/; find . ! -path './plugins/WorldEdit/schematics' -type d -exec rm -rf {} +' fi +rsync -Waqz -e "ssh -o StrictHostKeyChecking=no -T -c aes256-ctr -o Compression=no -x" --exclude-from="bin/excludes" serv@kaboom.pw:sync/ . 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