Files
FHC-Core/vilesci/cronjobs/cronjob.php
T
Andreas Österreicher d762d00163 - Cronjobverwaltung
- Anpassung an neue Firmenverwaltung 
- Bugfix Infoterminal, Login ohne Passwort nicht mehr moeglich
2010-03-18 13:48:16 +00:00

55 lines
2.0 KiB
PHP

<?php
/* Copyright (C) 2010 Technikum-Wien
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
*
* Authors: Christian Paminger < christian.paminger@technikum-wien.at >
* Andreas Oesterreicher < andreas.oesterreicher@technikum-wien.at >
* Rudolf Hangl < rudolf.hangl@technikum-wien.at >
* Gerald Simane-Sequens < gerald.simane-sequens@technikum-wien.at >
*/
/**
* Cronjob.php
*
* Dieses Script muss in der Crontab eingetragen werden. Von hier aus werden dann
* die entsprechenden anderen Scripte aufgerufen.
*/
require_once(dirname(__FILE__).'/../../config/vilesci.config.inc.php');
require_once(dirname(__FILE__).'/../../include/cronjob.class.php');
require_once(dirname(__FILE__).'/../../include/datum.class.php');
$datum = new datum();
$cj = new cronjob();
if(!$cj->getAll(SERVER_NAME,'reihenfolge',true))
die('Fehler beim Laden der Cronjobs');
foreach ($cj->result as $cronjob)
{
$timestamp = $cronjob->getNextExecutionTime();
if($timestamp && mktime()>=$timestamp)
{
//Starten des Jobs
if($cronjob->execute())
{
echo date('d.m.Y H:i:s').' '.$cronjob->titel.'('.$cronjob->cronjob_id.') executed<br>';
}
else
{
echo date('d.m.Y H:i:s').' '.$cronjob->titel.'('.$cronjob->cronjob_id.') <b>failed</b><br>';
}
}
}
?>