- - PR -
crontabでバッチ処理が行えない
投稿者 | 投稿内容 | ||||
---|---|---|---|---|---|
|
投稿日時: 2006-04-11 15:27
バッチ処理を行いたいのですがうまくいきません。
【実行したいプログラム】 -rwxr-xr-x 1 test test cron_test.sh 【crontabの設定】 6 * * * * /home/test/bat/cron_test.sh 2> /dev/null 【実行したいプログラム】は、xxx.txtに文字を出力するだけのもので、 コマンドから /home/test/bat/cron_test.sh と直接打った場合は実行できました。 何か設定が足りないのでしょうか?よろしくお願いします。 OS:RHEL ES3 | ||||
|
投稿日時: 2006-04-11 17:05
とりあえずエラー出力をnullに捨てるの止めてログを見てみることをお勧めします。
| ||||
|
投稿日時: 2006-04-11 19:09
>綾瀬さん
コメントありがとうございます。 ログを見ようともしたんですが、 6 * * * * /home/test/bat/cron_test.sh 2> /home/test/test_log.txt …のように記述してもエラーログのファイルが作成されませんでした。 ログの出力先は自由に指定できないのでしょうか? だとするとエラーログの出力先は何処になるのでしょうか? locateしてみてもそれらしいファイルは見つからなかったのですが… | ||||
|
投稿日時: 2006-04-11 20:00
こんばんわ.
touch かなにかで作ってからでは書き込まれませんか? パーミッションは? | ||||
|
投稿日時: 2006-04-11 20:11
/var/log/cron
に何かでてません? | ||||
|
投稿日時: 2006-04-11 20:25
>kazさん
こんばんは。コメントありがとうございます。 今、test_log.txtをパーミッション777で作成し、試してみました。 結果何も書き込まれませんでした。 | ||||
|
投稿日時: 2006-04-11 20:31
>せんさん
こんばんは、コメントありがとうございます。 /var/log/cronを見てみたところ、以下のように書かれていました。 (※重複箇所は削除してあります) Apr 11 20:15:01 sv crond[14728]: (root) CMD (/usr/bin/mrtg /etc/mrtg/mrtg.cfg --lock-file /var/lock/mrtg/mrtg_l --confcache-f ile /var/lib/mrtg/mrtg.ok) Apr 11 20:15:01 sv crond[1755]: (test) RELOAD (cron/test) Apr 11 20:15:01 sv crond[14730]: (root) CMD (/home/atw/stat.pl) Apr 11 20:15:02 sv crond[14731]: (root) CMD (/usr/sbin/relay-ctrl-age) Apr 11 20:15:24 sv crontab[14740]: (test) BEGIN EDIT (test) Apr 11 20:15:29 sv crontab[14740]: (test) REPLACE (test) Apr 11 20:15:29 sv crontab[14740]: (test) END EDIT (test) Apr 11 20:15:38 sv crontab[14743]: (test) LIST (test) Apr 11 20:16:01 sv crond[1755]: (test) RELOAD (cron/test) | ||||
|
投稿日時: 2006-04-11 22:58
こんばんは。
ゆうたさんの書かれている【crontabの設定】とは $ crontab -e で登録 されたのでしょうか? ※なんとなくですが、/etc/cron.d配下にcron_test.shをそのまま置いて 実行させようとしてませんか? |