- #!/bin/bash
- #先用ssh-copy-id配置免密登录
- cp -r dist/ dist-hipo/
- tar -zcvf dist-hipo.tar.gz ./dist-hipo
- scp dist-hipo.tar.gz root@hipo:/usr/share/nginx/html
- rm -rf dist-hipo
- rm -f dist-hipo.tar.gz
- ssh root@hipo <<EOF
- cd /usr/share/nginx/html
- mv dist-hipo/ dist-hipo-bak-$(date +%Y-%m-%d-%H:%M:%S)/
- tar -zxvf dist-hipo.tar.gz
- rm -f dist-hipo.tar.gz
- EOF
|