#!/usr/bin/perl -w $| = 1; #Setting節 #何分おきに更新するか my $exectime = 5; #リダイレクトで表示する場合は1。主に画像縮小をPHPスクリプトで行うときのため。 my $redirect = 0; #以下のディレクトリ指定は、相対パスでも絶対パスでも可 #mail-entryを設置したディレクトリ。相対パスでも絶対パスでも可。最後の/はいらない。 my $mailentry_dir = "/home/ycan/public_html/blog_maintenance/mail-entry"; #index.htmlを設置したディレクトリとインデックスファイル名 例:/hoge/index.html 相対パスの場合は、mail-entryを設置したディレクトリが基準 my $indexpage = "/home/ycan/public_html/supporter/index.html"; #mail-entry.cgiのURL(mail-entry.cgiまで含めてセットする) my $mailentry = "http://www.ycan.jp/blog_maintenance/mail-entry/mail-entry.cgi"; #Setting節ここまで use strict; chdir $mailentry_dir; open IN, "timelog.cgi"; my $before_time = ; close IN; my $now_time = time; if ($now_time - $before_time > 60*$exectime) { open FH, ">timelog.cgi"; print FH $now_time; close FH; if ($redirect) { print "Location: $mailentry\n\n"; } else { print "Content-type: text/html\n\n"; print `cat $indexpage`; exec ("./mail-entry.cgi > /dev/null"); # exec("./mail-entry.cgi > error.m2e.cgi"); } }else{ print "Content-type: text/html\n\n"; print exec("cat $indexpage"); }