1 |
|
---|
2 |
|
---|
3 |
|
---|
4 |
|
---|
5 |
|
---|
6 |
|
---|
7 |
|
---|
8 |
|
---|
9 |
|
---|
10 |
|
---|
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 |
|
---|
29 |
system("$toolpath/perl/getxml2db.pl"); |
---|
30 |
|
---|
31 |
|
---|
32 |
$now = &epoch2foldate(time()); |
---|
33 |
$now = &epoch2foldate($now); |
---|
34 |
$checkrangetime = $now + 15*60; |
---|
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 |
} |
---|
54 |
|
---|
55 |
|
---|
56 |
} |
---|