目录同步 linux,Linux系统目录实时同步
1.當操作系統根分區空間不夠時(有大量的日志寫入或應用部署在根分區),可以將單個或多個目錄進行同步出來,源目錄是磁盤較大的分區,目標目錄是在根分區下,實際文件寫入在較大的分區。
[root@mysql01 ~]# mkdir /home/123? /123? ? ? --創建兩個需要同步的目錄
[root@mysql01 ~]# vim /etc/fstab? ? ?--添加以下行
/home/123? ? ? ? ? ? ? ?/123? ? ? ? ? ? ? ? ? ? none? ? bind? ? ? ? ? ? 0 0
[root@mysql01 ~]# mount -a
[root@mysql01 ~]# touch /home/123/1.txt? ? ?--在源目錄寫入文件直接同步到目標目錄
[root@mysql01 ~]# ll /home/123/
total 0
-rw-r--r-- 1 root root 0 Mar 20 17:21 1.txt
[root@mysql01 ~]# ll /123/
total 0
-rw-r--r-- 1 root root 0 Mar 20 17:21 1.txt
[root@mysql01 ~]# touch /123/2.txt? ? ? -
-在目標目錄寫入文件直接同步到源目錄
[root@mysql01 ~]# ll /home/123/
total 0
-rw-r--r-- 1 root root 0 Mar 20 17:21 1.txt
-rw-r--r-- 1 root root 0 Mar 20 17:21 2.txt
[root@mysql01 ~]# ll /123/
total 0
-rw-r--r-- 1 root root 0 Mar 20 17:21 1.txt
-rw-r--r-- 1 root root 0 Mar 20 17:21 2.txt
[root@mysql01 ~]#
創作挑戰賽新人創作獎勵來咯,堅持創作打卡瓜分現金大獎總結
以上是生活随笔為你收集整理的目录同步 linux,Linux系统目录实时同步的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 葡萄城报表介绍:B/S 报表软件
- 下一篇: linux下makefile中cp,ma