雲端計算學習路線教程大綱課件:tar專案實戰案例

千鋒雲端計算發表於2019-09-23

雲端計算學習路線教程大綱課件:tar專案實戰案例:

雲端計算學習路線教程大綱課件: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

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


來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/69916964/viewspace-2657745/,如需轉載,請註明出處,否則將追究法律責任。

相關文章