Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Currently I have a crontab entry that does the following:

/etc/init.d/sendmail stop
/etc/init.d/sendmail start

In the category of "learn something new every day", I just came across watch (, and am wondering how to implement the updating of the sendmail aliases database via watching /etc/aliases for changes, rather than just blindly bouncing smtpd every day whether or not an update has occurred.

What is the right way of going about this, and should it still be run as a crontab entry, or can it be more-or-less daemonized?

share|improve this question
up vote 1 down vote accepted

If you're running Linux, there's inotify, and incron. In a manner similar to cron, incron can be configured to watch for filesystem change events (such as changes to configuration files like /etc/aliases), and to run processes in response.

share|improve this answer
I am on Linux (Ubuntu and CentOS) at the moment - these look pretty promising – warren Oct 20 '10 at 15:50

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.