Advertisement
Guest User

Untitled

a guest
Jun 8th, 2012
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. #!/usr/bin/perl -w
  2.  
  3. use DBI;
  4.  
  5. $dbh = DBI->connect('dbi:mysql:mythconverg',user,password)
  6. or die "Connection Error: $DBI::errstr\n";
  7.  
  8. $sql = "
  9. select r.title, r.subtitle, c.chanid, r.starttime
  10. from recorded r, channel c, record d
  11. where d.recordid = r.recordid and r.chanid = c.chanid
  12. and (
  13. select count(*)
  14. from recordedmarkup m
  15. where m.chanid = r.chanid
  16. and m.starttime = r.starttime
  17. ) = 0
  18. and c.commmethod <> -2
  19. and d.autocommflag = 1
  20. order by r.title, r.subtitle;";
  21.  
  22. $sth = $dbh->prepare($sql);
  23. $sth->execute
  24. or die "SQL Error: $DBI::errstr\n";
  25.  
  26. while (($title,$subtitle,$chanid,$starttime) = $sth->fetchrow_array) {
  27. @args = ("mythcommflag", "--rebuild", "--chanid", $chanid, "--starttime", $starttime);
  28. system(@args);
  29. # printf "mythcommflag --rebuild --chanid %s --starttime \"%s\" \n", $chanid, $starttime;
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement