Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Cloud Computing Learning Route course syllabus Courseware: a practical case of tar Project

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/03 Report--

Cloud Computing Learning Route course syllabus Courseware: practical case of tar Project:

=

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

[root@localhost ~] # systemctl start mariadb

[root@localhost ~] # mkdir / backup

Case 1:mysql physical backup and recovery

[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 /

Case 2:mysql physical backup and recovery

[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

Case 3:host A / etc (massive small files)-> host A / tmp

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

Case 4:host A / etc (massive small files)-> host B / tmp

General methods:

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

Suggested method:

= = host B listening port = =

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

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

Or

[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

=

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report