リターンメール
Subject: Output from "cron" command
Content-Type: text
Content-Length: 115
Your "cron" job
$HOME/public_html/knight/count/call.sh
produced the following output:
content-type: text/html <メッセージ出ているので呼び出しはできている <ERRと表示されないのでファイルOPENは成功している<ERR writeと表示さえないので書き込みも成功しているはず
--------------------------------------------------------
●crontab 設定
6 * * * * $HOME/public_html/knight/count/call.sh
--------------------------------------------------------
●シェル1
#!/bin/sh
/usr/local/bin/perl $HOME/public_html/knight/count/call.cgi
exit
--------------------------------------------------------
●CGI(perl)
#!/usr/local/bin/perl
print "content-type: text/html\n\n";
open(IN,"count.dat")|| print "ERR\n" ;
@regist = <IN>;
close(IN);
#処理
open(OUT,">count.dat")||print "ERR write\n" ;
print OUT "a";
print @regist;
close(OUT);
exit(0);
デバックの為、処理は省きますが、この状態でメールに何も表示されず、(読み込み失敗)またcount.dat に'a'とも書きこまれません(書き込み失敗) CGI count.dat 共に777にしてあります。
●フォルダの中身
call.sh call.cgi count.dat