#!/bin/bash mkdir -p /home/esuser cd /home/esuser wget http://10.12.xx.xx:8090/search_plugins/sd_waitforit_synonym.sh -O sd_waitforit_synonym.sh chown -R esuser.esuser /home/esuser/sd_waitforit_synonym.sh chown -R esuser.esuser /web/esuser chmod +x sd_waitforit_synonym.sh su - esuser -c 'bash /home/esuser/sd_waitforit_synonym.sh' echo "15 9 * * * esuser /bin/bash /home/esuser/sd_waitforit_synonym.sh > /home/search_v/var/elasticsearch/logs/sd_waitforit_synonym.log 2>&1 &" >> /etc/crontab cd /web/esuser/91a1f0b0-1369-4c39-b595-19cbf023/9200/elasticsearch-6.0.0-browser-search/elasticsearch-6.0.0-browser-search rm -rf plugins wget http://10.12.xx.xx:8090/search_plugins/plugins.tar.gz tar xf plugins.tar.gz chmod -R plugins cd /web/esuser/91a1f0b0-1369-4c39-b595-19cbf023/9200/elasticsearch-6.0.0-browser-search/elasticsearch-6.0.0-browser-search/config wget http://10.12.xx.xx:8090/search_plugins/sd_seg_ik.policy -O sd_seg_ik.policy cd /web/esuser/91a1f0b0-1369-4c39-b595-19cbf023/9200/elasticsearch-6.0.0-browser-search/elasticsearch-6.0.0-browser-search/bin mv elasticsearch elasticsearch.`date +%Y%m%d%H%M%S` wget http://10.12.xx.xx:8090/search_plugins/elasticsearch -O elasticsearch chown -R esuser.esuser /web/esuser cd /web/esuser/91a1f0b0-1369-4c39-b595-19cbf023/9201/elasticsearch-6.0.0-browser-search/elasticsearch-6.0.0-browser-search rm -rf plugins wget http://10.12.xx.xx:8090/search_plugins/plugins.tar.gz tar xf plugins.tar.gz chmod -R plugins cd /web/esuser/91a1f0b0-1369-4c39-b595-19cbf023/9201/elasticsearch-6.0.0-browser-search/elasticsearch-6.0.0-browser-search/config wget http://10.12.xx.xx:8090/search_plugins/sd_seg_ik.policy -O sd_seg_ik.policy cd /web/esuser/91a1f0b0-1369-4c39-b595-19cbf023/9201/elasticsearch-6.0.0-browser-search/elasticsearch-6.0.0-browser-search/bin mv elasticsearch elasticsearch.`date +%Y%m%d%H%M%S` wget http://10.12.xx.xx:8090/search_plugins/elasticsearch -O elasticsearch chown -R esuser.esuser /web/esuser cd /web/esuser/91a1f0b0-1369-4c39-b595-19cbf023/9202/elasticsearch-6.0.0-browser-search/elasticsearch-6.0.0-browser-search rm -rf plugins wget http://10.12.xx.xx:8090/search_plugins/plugins.tar.gz tar xf plugins.tar.gz chmod -R plugins cd /web/esuser/91a1f0b0-1369-4c39-b595-19cbf023/9202/elasticsearch-6.0.0-browser-search/elasticsearch-6.0.0-browser-search/config wget http://10.12.xx.xx:8090/search_plugins/sd_seg_ik.policy -O sd_seg_ik.policy cd /web/esuser/91a1f0b0-1369-4c39-b595-19cbf023/9202/elasticsearch-6.0.0-browser-search/elasticsearch-6.0.0-browser-search/bin mv elasticsearch elasticsearch.`date +%Y%m%d%H%M%S` wget http://10.12.xx.xx:8090/search_plugins/elasticsearch -O elasticsearch chown -R esuser.esuser /web/esuser cd /web/esuser/91a1f0b0-1369-4c39-b595-19cbf023/9203/elasticsearch-6.0.0-browser-search/elasticsearch-6.0.0-browser-search rm -rf plugins wget http://10.12.xx.xx:8090/search_plugins/plugins.tar.gz tar xf plugins.tar.gz chmod -R plugins cd /web/esuser/91a1f0b0-1369-4c39-b595-19cbf023/9203/elasticsearch-6.0.0-browser-search/elasticsearch-6.0.0-browser-search/config wget http://10.12.xx.xx:8090/search_plugins/sd_seg_ik.policy -O sd_seg_ik.policy cd /web/esuser/91a1f0b0-1369-4c39-b595-19cbf023/9203/elasticsearch-6.0.0-browser-search/elasticsearch-6.0.0-browser-search/bin mv elasticsearch elasticsearch.`date +%Y%m%d%H%M%S` wget http://10.12.xx.xx:8090/search_plugins/elasticsearch -O elasticsearch chown -R esuser.esuser /web/esuser su - esuser -c 'sh /web/esuser/91a1f0b0-1369-4c39-b595-19cbf023/9200/elasticsearch-6.0.0-browser-search/op_bin/shutdown.sh' su - esuser -c 'sh /web/esuser/91a1f0b0-1369-4c39-b595-19cbf023/9200/elasticsearch-6.0.0-browser-search/op_bin/start.sh' su - esuser -c 'sh /web/esuser/91a1f0b0-1369-4c39-b595-19cbf023/9201/elasticsearch-6.0.0-browser-search/op_bin/shutdown.sh' su - esuser -c 'sh /web/esuser/91a1f0b0-1369-4c39-b595-19cbf023/9201/elasticsearch-6.0.0-browser-search/op_bin/start.sh' su - esuser -c 'sh /web/esuser/91a1f0b0-1369-4c39-b595-19cbf023/9202/elasticsearch-6.0.0-browser-search/op_bin/shutdown.sh' su - esuser -c 'sh /web/esuser/91a1f0b0-1369-4c39-b595-19cbf023/9202/elasticsearch-6.0.0-browser-search/op_bin/start.sh' su - esuser -c 'sh /web/esuser/91a1f0b0-1369-4c39-b595-19cbf023/9203/elasticsearch-6.0.0-browser-search/op_bin/shutdown.sh' su - esuser -c 'sh /web/esuser/91a1f0b0-1369-4c39-b595-19cbf023/9203/elasticsearch-6.0.0-browser-search/op_bin/start.sh'
来源:https://www.cnblogs.com/lwhctv/p/10670157.html