コンピュータの再起動と同時にFetchmailが起動するように、以下のファイルを /etc/rc.d/init.dにファイル名fetchmailとして、作成しておくと良いでしょう。

#!/bin/sh
#
# chkconfig: 345 99 20
#
# description: Fetchmail auto start script

# Source function library.
. /etc/rc.d/init.d/functions

# See how we were called.
case "$1" in
  start)
        for user in `ls /home/`
        do
                if [ -f /home/$user/.fetchmailrc ]; then
                        echo "fetchmail for $user starting..."
                        su $user -c "/usr/bin/fetchmail --daemon 180"
                fi
        done
        ;;
  stop)
        # Stop daemons.
        for user in `ls /home/`
        do
                if [ -f /home/$user/.fetchmailrc ]; then
                        echo "fetchmail for $user stoping..."
                        su $user -c "/usr/bin/fetchmail --quit"
                fi
        done
        ;;
  *)
        echo "Usage: $0 {start|stop}"
        exit 1
esac

exit 0

>chkconfig --add fetchmail
>chkconfig --level 345 fetchmail start

:Mail


トップ   編集 凍結 差分 バックアップ 添付 複製 名前変更 リロード   新規 一覧 単語検索 最終更新   ヘルプ   最終更新のRSS
Last-modified: 2011-01-28 (金) 21:34:01 (4830d)