[ Index ]

PHP Cross Reference of Unnamed Project

title

Body

[close]

/se3master/usr/share/se3/sbin/ -> cron_wolstop.pl (source)

   1  #!/usr/bin/perl
   2  
   3  #
   4  ## $Id: cron_wolstop.pl 6654 2011-11-27 16:35:54Z dbo $ ##
   5  #
   6  ##### Effectue les actions programmées dans actionse3 #####
   7  ##
   8  #
   9  
  10  if (($ARGV[0] eq  "--help") || ($ARGV[0] eq "-h")) {
  11          print "Effectue les actions programmées dans actionse3\n";
  12      print "Usage : aucune option\n";
  13          exit;
  14  }
  15  require '/etc/SeConfig.ph';
  16  my $se3_db = DBI->connect("DBI:mysql:$connexionDb@$mysqlServerIp", $mysqlServerUsername, $mysqlServerPw)
  17  or die "Unable to connect to contacts Database: $se3_db->errstr\n";
  18  $se3_db->{RaiseError} = 1;
  19  
  20  ($sec,$min,$heure,$mjour,$mois,$annee,$sjour,$ajour,$isdst) =localtime(time);
  21  ($secbis,$minbis,$heurebis,$mjourbis,$moisbis,$anneebis,$sjourbis,$ajourbis,$isdstbis) =localtime(time+900);
  22  @jour=('d','l','ma','me','j','v','s');
  23  $table = "actionse3";
  24  
  25  $requete = "SELECT * FROM $table WHERE jour='$jour[$sjour]' and heure > '$heure:$min:$sec' and heure < '$heurebis:$minbis:$secbis';";
  26  #print $requete;
  27  my $sth = $se3_db->prepare($requete);
  28  $sth->execute or
  29  die "Unable to execute query: $se3_db->errstr\n";
  30  
  31  while (my $ref = $sth->fetchrow_hashref())
  32  {
  33         print $ref->{'heure'},"\n";
  34         system "/usr/share/se3/scripts/start_client.sh $ref->{'parc'} $ref->{'action'} ";
  35  }


Generated: Tue Mar 17 22:47:18 2015 Cross-referenced by PHPXref 0.7.1