Last active
May 29, 2020 15:23
-
-
Save NazarK/90c44e4375280892e45a72c7b242c745 to your computer and use it in GitHub Desktop.
script for quick moving server config (apps that I use nginx + RoR)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#copy ~/.ssh/* keys to new server | |
#add your ssh id_rsa.pub to source server authorized keys | |
#edit /etc/hosts add 111.111.111.111 source | |
scp root@source:/etc/nginx/nginx.conf /etc/nginx/ | |
scp -r root@source:/etc/nginx/sites-enabled/ /etc/nginx/ | |
scp -r root@source:/etc/letsencrypt /etc/ | |
#copy /var/www folder | |
ssh root@source 'cd /var; rm www.zip; zip -r www www -x *.log */tmp/* */current/* */releases/* */bundle/*' | |
scp root@source:/var/www.zip /var | |
cd /var; unzip www.zip | |
#copy crontab | |
ssh root@source 'crontab -l > /tmp/crontab' | |
scp root@source:/tmp/crontab /tmp/ | |
crontab /tmp/crontab | |
#copy database | |
#clone rails app to some folder | |
#make db:pull | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment