具体来说,我想跟踪我的grub.conf
(/boot/grub/grub.conf
)和一些oracle文件(即/db/app/oracle/product/10.2.0/db_1/network/admin/tnsnames.ora
)。
我尝试使用链接;但是etckeeper / git只跟踪链接指向的位置,而不跟踪实际内容。而且我无法创建硬链接,因为文件位于另一个卷上。
我知道我可以设置另一个GIT存储库,但我宁愿将其全部放在etckeeper中。
更新资料
根据nealmcb的回答,我想到了以下脚本:
#!/bin/sh
set -e
# Based on nealmcb's idea/script from http://serverfault.com/questions/211425/
# If you want other configuration data or files on the system also
# opportunistically tracked via etckeeper, use this script to copy them in.
# If there is a hook of some sort available related to the files
# you're mirroring, you can call etckeeper directly and track them
# proactively, rather than just opportunistically here.
MIRROR_ROOT=/etc/etckeeper.mirror.d
echo "etckeeper: mirroring outside files to $MIRROR_ROOT/:"
mirror_dir() {
LOCAL_PATH=$1
echo " $LOCAL_PATH"
mkdir -p $MIRROR_ROOT/$LOCAL_PATH
rsync -a $LOCAL_PATH/ $MIRROR_ROOT/$LOCAL_PATH
}
mirror_dir "/boot/grub"
mirror_dir "/root"
要添加或删除路径,您只需mirror_dir
在底部添加或删除呼叫。