码迷,mamicode.com
首页 > 其他好文 > 详细

云计算学习路线教程大纲课件:tar项目实战案例

时间:2019-09-21 10:36:31      阅读:89      评论:0      收藏:0      [点我收藏+]

标签:ane   云计   监听端口   systemctl   removing   项目   back   海量   lld   

云计算学习路线教程大纲课件:tar项目实战案例:

====================================================================================

[root@localhost ~]# yum -y install mariadb-server

[root@localhost ~]# systemctl start mariadb

[root@localhost ~]# mkdir /backup

案例1:mysql物理备份及恢复

[root@localhost ~]# tar -cJf /backup/mysql.tar.xz /var/lib/mysql

[root@localhost ~]# rm -rf /var/lib/mysql/*

[root@localhost ~]# tar -xf /backup/mysql.tar.xz -C /

案例2:mysql物理备份及恢复

[root@localhost ~]# cd /var/lib/mysql

[root@localhost mysql]# tar -cJf /backup/mysql.tar.xz *

[root@localhost mysql]# tar -xf /backup/mysql.tar.xz -C /var/lib/mysql

案例3:host A /etc (海量小文件) --------> host A /tmp

[root@localhost ~]# tar -czf etc.gz /etc -C /tmp

案例4:host A /etc (海量小文件) --------> host B /tmp

常规方法:

[root@localhost ~]# scp -r /etc 172.16.20.21:/tmp

建议方法:

==host B 监听端口==

[root@w_hat ~]# firewall-cmd --permanent --add-port=8888/tcp

[root@w_hat ~]# firewall-cmd --reload

[root@hostb ~]# systemctl stop firewalld.service

[root@hostb ~]# nc -l 8888 |tar -xzf - -C /tmp

==host A ==

[root@localhost ~]# tar -czf - /etc | nc 172.16.20.21 8888

tar: Removing leading `/‘ from member names

====================================================================================

云计算学习路线教程大纲课件:tar项目实战案例

标签:ane   云计   监听端口   systemctl   removing   项目   back   海量   lld   

原文地址:https://blog.51cto.com/14529670/2439733

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!