Creating a daemon is easy in shell script

#!/bin/bash
while :
do
    # add code to monitor dir here and take same action
done

Run monitor.sh in background or use nohup or friends:

nohup monitor.sh &

原理?暂未探究。。

 

来源:http://nixcraft.com/shell-scripting/14651-how-create-daemon-linux.html

posted @ 2012-08-13 17:53  nango  阅读(84)  评论(0)    收藏  举报