Subscribed unsubscribe Subscribe Subscribe

hasen's tech life

Twitter: @hasen

CentOS6でincrontabを入れた.

# incrontabを入れた

# version
$ cat /etc/redhat-release
> CentOS release 6.7 (Final)

# yum
$ sudo yum update -y
$ sudo yum install -y http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm
$ sudo yum install -y incron

# incron
$ sudo service incrond start
$ sudo chkconfig incrond on

# incrontab
$ sudo vi /etc/incron.conf
++ edior = vi
$ sudo incrontab -e -u root
++ /tmp/ IN_CREATE logger 'created new file'
$ sudo incrontab -d

# 確認
$ sudo touch /tmp/hoge.txt
$ sudo tail --l 1 /var/log/messages
> Sep 15 20:51:50 localhost vagrant: 'created new file'