2018年8月2日 星期四

Lsyncd - Live syncing Daemon 資料夾同步

  在 Linux 上若要將兩個資料夾同步,大部分會想到用 rsync 這個指令,在第二次同步時,它會比對兩個資料夾不同之處,而只同步這些不同之處,所以相對之下,在第二次之後的同步,是較快速,較省網路流量的。如果兩個資料夾是分處於兩台不同電腦上,rsync 還可以使用 ssh 加密連線來傳輸資料。再搭配上系統排程 cron,即可達成定時同步的需求。

如果須要的是即時同步,那 rsync 就只能把 cron 的時間間隔縮短,但要縮多短?如果資料夾內資料較多,rsync 比對的時間就會拉長,所以根本無法確定同步的時間間隔該設定多少,而且資料越多,時間間隔就須越長,就越不即時....

這裡要介紹的 lsyncd 指令,它是基於 inotify(註¹) 的檔案監測機制,當檔案或資料夾有變動時,inotify 會記錄下來並回復 lsycnd 檔案已更動,lsyncd 預設每 20 秒同步這些已更動過的檔案,若要同步的目的地資料夾是在別台電腦,lsyncd 支援使用 ssh 加密連線來傳輸資料。

雖說 lsyncd 也不算是即時同步,但把同步時間縮短到每秒,其效果也算接近即時同步了。


		
 

 

 

 

2018年7月25日 星期三

Extra Packages for Enterprise Linux (EPEL)

About EPEL
EPEL was started because many Fedora contributors wanted to use the Fedora packages they maintain on Red Hat Enterprise Linux (RHEL) and its compatible derivatives.

Goals of the EPEL Effort
Make high quality packages that have been developed, tested, and improved in Fedora available for RHEL and compatible derivatives such as CentOS and Scientific Linux.

Work closely with the Fedora Project to achieve this goal -- use the same guidelines, rules, policies, and infrastructure, as far as possible.

If we hit problems, solve the problems with the other parties and groups of Fedora, such as Packaging Committee, instead of creating EPEL-only solutions; EPEL-only solutions introduce confusion for packagers and users, and make porting packages between Fedora and EPEL harder.

For the rare cases where it is not possible or desired to remain synchronized with Fedora, maintain add-on documents for EPEL that describe the differences and the reasons for them.

以上取自 Fedora Project Wikihttps://fedoraproject.org/wiki/About_EPEL