チェンジセット 94: trunk/install/perl/schedulecheck.pl
- コミット日時:
- 2010/02/28 22:28:26 (15 年前)
- ファイル:
凡例:
- 変更無し
- 追加
- 削除
- 更新
- コピー
- 移動
trunk/install/perl/schedulecheck.pl
r1 r94 14 14 use DBI; 15 15 use DBD::Pg; 16 use DBD::SQLite; 16 17 use Schedule::At; 17 18 use Time::Local; … … 19 20 $path = $0; 20 21 $path =~ s/schedulecheck.pl$//i; 21 if ($p wdne "./"){22 if ($path ne "./"){ 22 23 push( @INC, "$path"); 23 24 } … … 29 30 30 31 #予約番組探し 31 $now = &epoch2foldate( `date +%s`);32 $now = &epoch2foldate(time()); 32 33 $now = &epoch2foldate($now); 33 34 $checkrangetime = $now + 15*60;#15分後まで 34 35 $checkrangetime = &epoch2foldate($checkrangetime); 35 36 36 my $data_source = sprintf("dbi:%s:dbname=%s;host=%s;port=%d", 37 $DBDriv,$DBName,$DBHost,$DBPort); 38 $dbh = DBI->connect($data_source,$DBUser,$DBPass) ||die $DBI::error;; 37 $dbh = DBI->connect($DSN,$DBUser,$DBPass) ||die $DBI::error;; 39 38 40 $DBQuery = "SELECT count(*) FROM foltia_tvrecord "; 41 42 43 $sth = $dbh->prepare($DBQuery); 39 $sth = $dbh->prepare($stmt{'schedulecheck.1'}); 44 40 $sth->execute(); 45 41 @titlecount= $sth->fetchrow_array; … … 48 44 exit; 49 45 }else{ 50 51 $DBQuery = "SELECT tid ,stationid FROM foltia_tvrecord "; 52 $sth = $dbh->prepare($DBQuery); 46 $sth = $dbh->prepare($stmt{'schedulecheck.2'}); 53 47 $sth->execute(); 54 48 while (($tid,$stationid ) = $sth->fetchrow_array()) {