lnmp网站搬家教程SSH端

经过这次折腾,可是把我给折腾惨了,自己在网上搜索总结,测试了下,以下代码对lnmp.org上的lnmp安装包适用。这样备份和恢复都成了方便的事情了

备份

[php]

killall nginx
service mysql stop
tar zcvf /home/wwwroot/wwwroot.tar.gz /home/wwwroot
tar zcvf /home/wwwroot/nginx.tar.gz /usr/local/nginx/conf
tar zcvf /home/wwwroot/mysql.tar.gz /usr/local/mysql/var
tar zcvf /home/wwwroot/php.tar.gz /usr/local/php/etc
/usr/local/nginx/sbin/nginx
service mysql start

[/php]

 

还原

[php]

killall nginx
service mysql stop
tar zxvf wwwroot.tar.gz
tar zxvf nginx.tar.gz
tar zxvf mysql.tar.gz
tar zxvf php.tar.gz
mv /usr/local/nginx/conf /usr/local/nginx/conf-bak
mv /usr/local/mysql/var /usr/local/mysql/var-bak
mv usr/local/php/etc usr/local/php/etc-bak
mv home/wwwroot /home/wwwroot
mv usr/local/nginx/conf /usr/local/nginx/conf
mv usr/local/mysql/var /usr/local/mysql/var
mv usr/local/php/etc /usr/local/php/etc
chown -R mysql /usr/local/mysql/var
chown -R www /usr/local/nginx/conf
/usr/local/nginx/sbin/nginx

/etc/init.d/mysql start

[/php]

 

版权声明:
作者:珍惜
链接:https://xiaw.top/2039.html
来源:生活回忆
文章版权归作者所有,未经允许请勿转载。

THE END
分享
二维码
< <上一篇
下一篇>>