・それ etckeeper でできるよ - /etc 以下を Git で自動的にバージョン管理 - 彼女からは、おいちゃんと呼ばれています
yum -y install etckeeper Loaded plugins: fastestmirror, priorities Loading mirror speeds from cached hostfile * epel: ftp.iij.ad.jp * ius: mirror.rackspace.com * sl: ftp.riken.jp * sl-security: ftp.riken.jp 90 packages excluded due to repository priority protections Setting up Install Process Resolving Dependencies --> Running transaction check ---> Package etckeeper.noarch 0:0.58-1.el6 will be installed --> Finished Dependency Resolution Dependencies Resolved ================================================================================ Package Arch Version Repository Size ================================================================================ Installing: etckeeper noarch 0.58-1.el6 epel 37 k Transaction Summary ================================================================================ Install 1 Package(s) Total download size: 37 k Installed size: 60 k Downloading Packages: etckeeper-0.58-1.el6.noarch.rpm | 37 kB 00:00 Running rpm_check_debug Running Transaction Test Transaction Test Succeeded Running Transaction Installing : etckeeper-0.58-1.el6.noarch 1/1 Installed: etckeeper.noarch 0:0.58-1.el6 Complete!
cd /etc etckeeper init Initialized empty Git repository in /etc/.git/以下の設定は対象を限定したい場合に実施。
git rm --cached -r -f ./ vi .gitignore
先頭に以下の2行を追加。 /* /.* 最後に以下を追加。 !/cron.monthly !/cron.weekly !/fail2ban !/httpd !/logwatch !/my.cnf !/nginx !/pam.d !/pear !/pear.conf !/php-fpm.conf !/php-fpm.d !/php.d !/php.ini !/postfix !/rsyslog.conf !/ssh !/ssl !/sysconfig !/vsftpd !/yum !/yum.conf !/yum.repos.d
git add -f .etckeeper git add -f .gitignore git add -A etckeeper commit "First commit"
0 件のコメント:
コメントを投稿