2024年11月2日 星期六

inotify-tools

inotify-tools 工具,可以監控檔案系統的異動,後續觸發想要的動作,
例如此腳本監控 /abc 目錄,後續觸發 rsync 動作
while true
do
inotifywait -e modify -e create -e delete /abc
rsync -au /abc/ /def/
done

加 -d 參數可以常駐執行,監控 Event 存成 Log
inotifywait -dr --timefmt '%F %T' --format '%T %w%f %e' /abc -o /var/log/inotifywait.log

另外一個指令 inotifywatch 感覺比較沒用,它是監控一段指定時間或直到按 Ctrl-C,顯示 Event Counter

沒有留言:

x86-64-v3 is required by RHEL10

RHEL10 必需要 x86-64-v3 指令集的 CPU 才能安裝, 太舊的電腦(超過十年)可能都沒辦法裝,連開機都不行 替代方案可使用 Almalinux ,仍有提供 x86_64_v2 的版本 TWDS mirror Almalinux 所提供的 x86_64,跟 RHEL...