使用硬链接和颠覆pipe理configuration文件?

我正在考虑将configuration文件硬连接到我的SVNconfiguration库的工作副本。 有什么理由不以这种方式pipe理configuration文件?

假设/ home / user / confmgr / confs是我的configuration库的工作副本。 然后我可以硬链接configuration文件如下 –

ln /etc/php.ini /home/user/confmgr/confs/php.ini ln /etc/httpd/conf/httpd.conf /home/user/confmgr/confs/httpd.conf 

然后,当我需要编辑一个configuration文件,这是很简单的

 cd /home/user/confmgr/confs vi httpd.conf /sbin/service httpd configtest /sbin/service httpd graceful svn commit -m 'adding virtual host to httpd.conf for new project' 

一些观察结果几乎相反:

  1. 为什么不符号链接?
  2. 考虑转向你的工作stream程。 安全地对第二份工作拷贝进行修改,审查和提交,然后在实际使用中svn up工作拷贝。
  3. 有更复杂的工具来pipe理版本控制的复杂configuration结构。 考虑使用Puppet , BCFG2 , etckeeper等。

我不会把他们放在/家里

将configuration文件放在根文件系统的某处。

这是因为/安装在其他文件系统之前,所以有可能需要位于尚未安装的文件系统上的configuration文件。

我也会使用符号链接而不是硬链接。 跨文件系统的硬链接是不允许的(iirc),当你从SVN(更改inode)检出更新文件时,你可能会断链。

你需要非常小心,但我不明白为什么你不能运行这个configuration的原因。

etc-keeper可能是您的一个很好的参考devise:

etckeeper是一个让/ etc存储在git,mercurial,darcs或者bzr仓库中的工具集合。

它将回购存储在/etc/.$RCS中,但不支持SVN。 我不知道为什么; 作者只是说他尝试过了,而且很糟糕。 本质上,这种方法使/ etc 成为工作副本