腕利きのSEはどうやって問題を調査するか実例
(例題)crontab -eでcronを設定しても動かないようだ
- まず、syslogをみて、本当にcronが動いていないか確認
- 本当に動いていないようだ
- ユーザーごとのcronの設定はどこにあるのかな?
- dpkg -l|grep cron を実行し、crondのパッケージ名を調査
- dpkg -L cron 実行し、インストールされているファイル一式を引っ張る
- この中から保存されていそうなディレクトリを片っ端から調査
- 動的なデータは/usr/libか/varのどちらかに入るので該当部分を引っ張る
/usr /usr/bin /usr/bin/crontab /usr/sbin /usr/sbin/cron /usr/share /usr/share/man /usr/share/man/man1 /usr/share/man/man1/crontab.1.gz /usr/share/man/man5 /usr/share/man/man5/crontab.5.gz /usr/share/man/man8 /usr/share/man/man8/cron.8.gz /usr/share/doc /usr/share/doc/cron /usr/share/doc/cron/FEATURES /usr/share/doc/cron/THANKS /usr/share/doc/cron/README /usr/share/doc/cron/README.anacron /usr/share/doc/cron/README.Debian /usr/share/doc/cron/TODO.Debian /usr/share/doc/cron/copyright /usr/share/doc/cron/NEWS.Debian.gz /usr/share/doc/cron/changelog.gz /usr/share/doc/cron/changelog.Debian.gz /etc /etc/cron.hourly /etc/cron.hourly/.placeholder /etc/cron.daily /etc/cron.daily/.placeholder /etc/cron.daily/standard /etc/cron.weekly /etc/cron.weekly/.placeholder /etc/cron.monthly /etc/cron.monthly/.placeholder /etc/cron.monthly/standard /etc/cron.d /etc/cron.d/.placeholder /etc/init.d /etc/init.d/cron /etc/pam.d /etc/pam.d/cron /etc/crontab /var /var/spool /var/spool/cron /var/spool/cron/crontabs
- みた感じ、/var/spool/cron/crontabsにありそうだ。
- わからなかったら片っ端から調査。
- ユーザー名のファイルがあるので中身を確認
- 中身をみると、時刻が違う。
- 結論として、crontab -e は終了しないと反映されないらしい。
- 解決ちゃんちゃん