Index: trunk/install/perl/schedulecheck.pl =================================================================== --- trunk/install/perl/schedulecheck.pl (リビジョン 1) +++ trunk/install/perl/schedulecheck.pl (リビジョン 94) @@ -14,4 +14,5 @@ use DBI; use DBD::Pg; +use DBD::SQLite; use Schedule::At; use Time::Local; @@ -19,5 +20,5 @@ $path = $0; $path =~ s/schedulecheck.pl$//i; -if ($pwd ne "./"){ +if ($path ne "./"){ push( @INC, "$path"); } @@ -29,17 +30,12 @@ #予約番組探し -$now = &epoch2foldate(`date +%s`); +$now = &epoch2foldate(time()); $now = &epoch2foldate($now); $checkrangetime = $now + 15*60;#15分後まで $checkrangetime = &epoch2foldate($checkrangetime); - my $data_source = sprintf("dbi:%s:dbname=%s;host=%s;port=%d", - $DBDriv,$DBName,$DBHost,$DBPort); - $dbh = DBI->connect($data_source,$DBUser,$DBPass) ||die $DBI::error;; +$dbh = DBI->connect($DSN,$DBUser,$DBPass) ||die $DBI::error;; -$DBQuery = "SELECT count(*) FROM foltia_tvrecord "; - - - $sth = $dbh->prepare($DBQuery); +$sth = $dbh->prepare($stmt{'schedulecheck.1'}); $sth->execute(); @titlecount= $sth->fetchrow_array; @@ -48,7 +44,5 @@ exit; }else{ - -$DBQuery = "SELECT tid ,stationid FROM foltia_tvrecord "; - $sth = $dbh->prepare($DBQuery); + $sth = $dbh->prepare($stmt{'schedulecheck.2'}); $sth->execute(); while (($tid,$stationid ) = $sth->fetchrow_array()) {