root/trunk/install/perl/schedulecheck.pl

リビジョン 94, 1.1 kB (コミッタ: sorshi, コミット時期: 14 年 前)

SQLite採用

  • svn:executable 属性の設定値:
Line 
1 #!/usr/bin/perl
2 #
3 # Anime recording system foltia
4 # http://www.dcc-jpl.com/soft/foltia/
5 #
6 #schedulecheck.pl
7 #
8 #DBの予約から定期的に予約キューを作り出します
9 #
10 # DCC-JPL Japan/foltia project
11 #
12 #
13
14 use DBI;
15 use DBD::Pg;
16 use DBD::SQLite;
17 use Schedule::At;
18 use Time::Local;
19
20 $path = $0;
21 $path =~ s/schedulecheck.pl$//i;
22 if ($path ne "./"){
23 push( @INC, "$path");
24 }
25
26 require "foltialib.pl";
27
28 #XMLゲット&更新
29 system("$toolpath/perl/getxml2db.pl");
30
31 #予約番組探し
32 $now = &epoch2foldate(time());
33 $now = &epoch2foldate($now);
34 $checkrangetime = $now   + 15*60;#15分後まで
35 $checkrangetime =  &epoch2foldate($checkrangetime);
36
37 $dbh = DBI->connect($DSN,$DBUser,$DBPass) ||die $DBI::error;;
38
39 $sth = $dbh->prepare($stmt{'schedulecheck.1'});
40         $sth->execute();
41  @titlecount= $sth->fetchrow_array;
42
43  if ($titlecount[0]  == 0 ){
44 exit;
45 }else{
46     $sth = $dbh->prepare($stmt{'schedulecheck.2'});
47         $sth->execute();
48 while (($tid,$stationid  ) = $sth->fetchrow_array()) {
49 #キュー再投入
50 system ("$toolpath/perl/addatq.pl $tid $stationid  ");
51 &writelog("schedulecheck  $toolpath/perl/addatq.pl $tid $stationid ");
52
53 }#while
54
55
56 }
Note: リポジトリブラウザについてのヘルプは TracBrowser を参照してください。
track feed