1. Import
This commit is contained in:
144
html/sysadmin/cron/cron_export_HTG.php
Normal file
144
html/sysadmin/cron/cron_export_HTG.php
Normal file
@@ -0,0 +1,144 @@
|
||||
<?php
|
||||
/*=======================================================================
|
||||
*
|
||||
* cron_export.php
|
||||
*
|
||||
=======================================================================*/
|
||||
|
||||
|
||||
include_once ("../include/mcglobal.inc.php");
|
||||
include_once ("../include/ftp.inc.php");
|
||||
|
||||
|
||||
if ($argv[1] == "acapella7890") :
|
||||
|
||||
// Error reporting
|
||||
error_reporting(E_ERROR | E_WARNING | E_PARSE);
|
||||
|
||||
$path = getAbsoluteSystemPath();
|
||||
$passwd = "acapella7890";
|
||||
$logFile = $path . "/log/sys_auto_export.log";
|
||||
$emptyArgument = "\"\"";
|
||||
$fileNamePrefix = substr(getDateTime("6"), 0, 12); // Format: "YmdHi"
|
||||
|
||||
if ($argv[2] == "today") :
|
||||
$toDay = getDateTime("day");
|
||||
$toMonth = getDateTime("month");
|
||||
$toYear = getDateTime("year");
|
||||
else :
|
||||
$toDay = getDateTime("day_yesterday");
|
||||
$toMonth = getDateTime("month_yesterday");
|
||||
$toYear = getDateTime("year_yesterday");
|
||||
endif;
|
||||
|
||||
|
||||
// Arguments
|
||||
// $hq_id $usr_id $dummy_01 $f_act $f_exp_category $f_delimiter $f_parname $f_parname_export $f_fileName $day_to $month_to $year_to $f_cs_eid_filter $f_jbp_filter $specialJbPayment $jbpc_id
|
||||
|
||||
$exportPars = array();
|
||||
|
||||
$exportPars["HTG_HB_DEB"] = array("101","5546","_","export","1","|","RETRANS Debitorenstammsatz","RETRANS Debitorenstammsatz",$fileNamePrefix . ".003.deb",$toDay,$toMonth,$toYear,$emptyArgument,$emptyArgument,"","");
|
||||
$exportPars["HTG_HB_KRED"] = array("101","5546","_","export","2","|","RETRANS Kreditorenstammsatz","RETRANS Kreditorenstammsatz",$fileNamePrefix . ".003.kred",$toDay,$toMonth,$toYear,$emptyArgument,$emptyArgument,"","");
|
||||
$exportPars["HTG_HB_FZG"] = array("101","5546","_","export","3","|","RETRANS Fahrzeugstammsatz","RETRANS Fahrzeugstammsatz",$fileNamePrefix . ".003.fzg",$toDay,$toMonth,$toYear,$emptyArgument,$emptyArgument,"","");
|
||||
$exportPars["HTG_HB_ABR"] = array("101","5546","_","export","5","|","RETRANS Abrechnungen","RETRANS Abrechnungen",$fileNamePrefix . ".003.abr",$toDay,$toMonth,$toYear,$emptyArgument,$emptyArgument,"","");
|
||||
$exportPars["HTG_HB_GUT"] = array("101","5546","_","export","6","|","RETRANS Abrechnungen","RETRANS Abrechnungen",$fileNamePrefix . ".003.gut",$toDay,$toMonth,$toYear,$emptyArgument,$emptyArgument,"","");
|
||||
|
||||
$exportPars["HTG_HH_DEB"] = array("102","7657","_","export","1","|","RETRANS Debitorenstammsatz","RETRANS Debitorenstammsatz",$fileNamePrefix . ".001.deb",$toDay,$toMonth,$toYear,$emptyArgument,$emptyArgument,"","");
|
||||
$exportPars["HTG_HH_KRED"] = array("102","7657","_","export","2","|","RETRANS Kreditorenstammsatz","RETRANS Kreditorenstammsatz",$fileNamePrefix . ".001.kred",$toDay,$toMonth,$toYear,$emptyArgument,$emptyArgument,"","");
|
||||
$exportPars["HTG_HH_FZG"] = array("102","7657","_","export","3","|","RETRANS Fahrzeugstammsatz","RETRANS Fahrzeugstammsatz",$fileNamePrefix . ".001.fzg",$toDay,$toMonth,$toYear,$emptyArgument,$emptyArgument,"","");
|
||||
$exportPars["HTG_HH_ABR"] = array("102","7657","_","export","5","|","RETRANS Abrechnungen","RETRANS Abrechnungen",$fileNamePrefix . ".001.abr",$toDay,$toMonth,$toYear,$emptyArgument,$emptyArgument,"","");
|
||||
$exportPars["HTG_HH_GUT"] = array("102","7657","_","export","6","|","RETRANS Abrechnungen","RETRANS Abrechnungen",$fileNamePrefix . ".001.gut",$toDay,$toMonth,$toYear,$emptyArgument,$emptyArgument,"","");
|
||||
|
||||
$exportPars["HTG_B_DEB"] = array("103","6726","_","export","1","|","RETRANS Debitorenstammsatz","RETRANS Debitorenstammsatz",$fileNamePrefix . ".007.deb",$toDay,$toMonth,$toYear,$emptyArgument,$emptyArgument,"","");
|
||||
$exportPars["HTG_B_KRED"] = array("103","6726","_","export","2","|","RETRANS Kreditorenstammsatz","RETRANS Kreditorenstammsatz",$fileNamePrefix . ".007.kred",$toDay,$toMonth,$toYear,$emptyArgument,$emptyArgument,"","");
|
||||
$exportPars["HTG_B_FZG"] = array("103","6726","_","export","3","|","RETRANS Fahrzeugstammsatz","RETRANS Fahrzeugstammsatz",$fileNamePrefix . ".007.fzg",$toDay,$toMonth,$toYear,$emptyArgument,$emptyArgument,"","");
|
||||
$exportPars["HTG_B_ABR"] = array("103","6726","_","export","5","|","RETRANS Abrechnungen","RETRANS Abrechnungen",$fileNamePrefix . ".007.abr",$toDay,$toMonth,$toYear,$emptyArgument,$emptyArgument,"","");
|
||||
$exportPars["HTG_B_GUT"] = array("103","6726","_","export","6","|","RETRANS Abrechnungen","RETRANS Abrechnungen",$fileNamePrefix . ".007.gut",$toDay,$toMonth,$toYear,$emptyArgument,$emptyArgument,"","");
|
||||
|
||||
$exportPars["HTG_H_DEB"] = array("104","7329","_","export","1","|","RETRANS Debitorenstammsatz","RETRANS Debitorenstammsatz",$fileNamePrefix . ".006.deb",$toDay,$toMonth,$toYear,$emptyArgument,$emptyArgument,"","");
|
||||
$exportPars["HTG_H_KRED"] = array("104","7329","_","export","2","|","RETRANS Kreditorenstammsatz","RETRANS Kreditorenstammsatz",$fileNamePrefix . ".006.kred",$toDay,$toMonth,$toYear,$emptyArgument,$emptyArgument,"","");
|
||||
$exportPars["HTG_H_FZG"] = array("104","7329","_","export","3","|","RETRANS Fahrzeugstammsatz","RETRANS Fahrzeugstammsatz",$fileNamePrefix . ".006.fzg",$toDay,$toMonth,$toYear,$emptyArgument,$emptyArgument,"","");
|
||||
$exportPars["HTG_H_ABR"] = array("104","7329","_","export","5","|","RETRANS Abrechnungen","RETRANS Abrechnungen",$fileNamePrefix . ".006.abr",$toDay,$toMonth,$toYear,$emptyArgument,$emptyArgument,"","");
|
||||
$exportPars["HTG_H_GUT"] = array("104","7329","_","export","6","|","RETRANS Abrechnungen","RETRANS Abrechnungen",$fileNamePrefix . ".006.gut",$toDay,$toMonth,$toYear,$emptyArgument,$emptyArgument,"","");
|
||||
|
||||
$exportPars["HTG_F_DEB"] = array("105","9540","_","export","1","|","RETRANS Debitorenstammsatz","RETRANS Debitorenstammsatz",$fileNamePrefix . ".002.deb",$toDay,$toMonth,$toYear,$emptyArgument,$emptyArgument,"","");
|
||||
$exportPars["HTG_F_KRED"] = array("105","9540","_","export","2","|","RETRANS Kreditorenstammsatz","RETRANS Kreditorenstammsatz",$fileNamePrefix . ".002.kred",$toDay,$toMonth,$toYear,$emptyArgument,$emptyArgument,"","");
|
||||
$exportPars["HTG_F_FZG"] = array("105","9540","_","export","3","|","RETRANS Fahrzeugstammsatz","RETRANS Fahrzeugstammsatz",$fileNamePrefix . ".002.fzg",$toDay,$toMonth,$toYear,$emptyArgument,$emptyArgument,"","");
|
||||
$exportPars["HTG_F_ABR"] = array("105","9540","_","export","5","|","RETRANS Abrechnungen","RETRANS Abrechnungen",$fileNamePrefix . ".002.abr",$toDay,$toMonth,$toYear,$emptyArgument,$emptyArgument,"","");
|
||||
$exportPars["HTG_F_GUT"] = array("105","9540","_","export","6","|","RETRANS Abrechnungen","RETRANS Abrechnungen",$fileNamePrefix . ".002.gut",$toDay,$toMonth,$toYear,$emptyArgument,$emptyArgument,"","");
|
||||
|
||||
$exportPars["HTG_DD_DEB"] = array("106","6449","_","export","1","|","RETRANS Debitorenstammsatz","RETRANS Debitorenstammsatz",$fileNamePrefix . ".005.deb",$toDay,$toMonth,$toYear,$emptyArgument,$emptyArgument,"","");
|
||||
$exportPars["HTG_DD_KRED"] = array("106","6449","_","export","2","|","RETRANS Kreditorenstammsatz","RETRANS Kreditorenstammsatz",$fileNamePrefix . ".005.kred",$toDay,$toMonth,$toYear,$emptyArgument,$emptyArgument,"","");
|
||||
$exportPars["HTG_DD_FZG"] = array("106","6449","_","export","3","|","RETRANS Fahrzeugstammsatz","RETRANS Fahrzeugstammsatz",$fileNamePrefix . ".005.fzg",$toDay,$toMonth,$toYear,$emptyArgument,$emptyArgument,"","");
|
||||
$exportPars["HTG_DD_ABR"] = array("106","6449","_","export","5","|","RETRANS Abrechnungen","RETRANS Abrechnungen",$fileNamePrefix . ".005.abr",$toDay,$toMonth,$toYear,$emptyArgument,$emptyArgument,"","");
|
||||
$exportPars["HTG_DD_GUT"] = array("106","6449","_","export","6","|","RETRANS Abrechnungen","RETRANS Abrechnungen",$fileNamePrefix . ".005.gut",$toDay,$toMonth,$toYear,$emptyArgument,$emptyArgument,"","");
|
||||
|
||||
$exportPars["HTG_E_DEB"] = array("107","9755","_","export","1","|","RETRANS Debitorenstammsatz","RETRANS Debitorenstammsatz",$fileNamePrefix . ".009.deb",$toDay,$toMonth,$toYear,$emptyArgument,$emptyArgument,"","");
|
||||
$exportPars["HTG_E_KRED"] = array("107","9755","_","export","2","|","RETRANS Kreditorenstammsatz","RETRANS Kreditorenstammsatz",$fileNamePrefix . ".009.kred",$toDay,$toMonth,$toYear,$emptyArgument,$emptyArgument,"","");
|
||||
$exportPars["HTG_E_FZG"] = array("107","9755","_","export","3","|","RETRANS Fahrzeugstammsatz","RETRANS Fahrzeugstammsatz",$fileNamePrefix . ".009.fzg",$toDay,$toMonth,$toYear,$emptyArgument,$emptyArgument,"","");
|
||||
$exportPars["HTG_E_ABR"] = array("107","9755","_","export","5","|","RETRANS Abrechnungen","RETRANS Abrechnungen",$fileNamePrefix . ".009.abr",$toDay,$toMonth,$toYear,$emptyArgument,$emptyArgument,"","");
|
||||
$exportPars["HTG_E_GUT"] = array("107","9755","_","export","6","|","RETRANS Abrechnungen","RETRANS Abrechnungen",$fileNamePrefix . ".009.gut",$toDay,$toMonth,$toYear,$emptyArgument,$emptyArgument,"","");
|
||||
|
||||
$exportPars["HTG_L_DEB"] = array("108","9248","_","export","1","|","RETRANS Debitorenstammsatz","RETRANS Debitorenstammsatz",$fileNamePrefix . ".008.deb",$toDay,$toMonth,$toYear,$emptyArgument,$emptyArgument,"","");
|
||||
$exportPars["HTG_L_KRED"] = array("108","9248","_","export","2","|","RETRANS Kreditorenstammsatz","RETRANS Kreditorenstammsatz",$fileNamePrefix . ".008.kred",$toDay,$toMonth,$toYear,$emptyArgument,$emptyArgument,"","");
|
||||
$exportPars["HTG_L_FZG"] = array("108","9248","_","export","3","|","RETRANS Fahrzeugstammsatz","RETRANS Fahrzeugstammsatz",$fileNamePrefix . ".008.fzg",$toDay,$toMonth,$toYear,$emptyArgument,$emptyArgument,"","");
|
||||
$exportPars["HTG_L_ABR"] = array("108","9248","_","export","5","|","RETRANS Abrechnungen","RETRANS Abrechnungen",$fileNamePrefix . ".008.abr",$toDay,$toMonth,$toYear,$emptyArgument,$emptyArgument,"","");
|
||||
$exportPars["HTG_L_GUT"] = array("108","9248","_","export","6","|","RETRANS Abrechnungen","RETRANS Abrechnungen",$fileNamePrefix . ".008.gut",$toDay,$toMonth,$toYear,$emptyArgument,$emptyArgument,"","");
|
||||
|
||||
$exportPars["HTG_M_DEB"] = array("109","10041","_","export","1","|","RETRANS Debitorenstammsatz","RETRANS Debitorenstammsatz",$fileNamePrefix . ".013.deb",$toDay,$toMonth,$toYear,$emptyArgument,$emptyArgument,"","");
|
||||
$exportPars["HTG_M_KRED"] = array("109","10041","_","export","2","|","RETRANS Kreditorenstammsatz","RETRANS Kreditorenstammsatz",$fileNamePrefix . ".013.kred",$toDay,$toMonth,$toYear,$emptyArgument,$emptyArgument,"","");
|
||||
$exportPars["HTG_M_FZG"] = array("109","10041","_","export","3","|","RETRANS Fahrzeugstammsatz","RETRANS Fahrzeugstammsatz",$fileNamePrefix . ".013.fzg",$toDay,$toMonth,$toYear,$emptyArgument,$emptyArgument,"","");
|
||||
$exportPars["HTG_M_ABR"] = array("109","10041","_","export","5","|","RETRANS Abrechnungen","RETRANS Abrechnungen",$fileNamePrefix . ".013.abr",$toDay,$toMonth,$toYear,$emptyArgument,$emptyArgument,"","");
|
||||
$exportPars["HTG_M_GUT"] = array("109","10041","_","export","6","|","RETRANS Abrechnungen","RETRANS Abrechnungen",$fileNamePrefix . ".013.gut",$toDay,$toMonth,$toYear,$emptyArgument,$emptyArgument,"","");
|
||||
|
||||
$exportPars["HTG_N_DEB"] = array("110","10316","_","export","1","|","RETRANS Debitorenstammsatz","RETRANS Debitorenstammsatz",$fileNamePrefix . ".023.deb",$toDay,$toMonth,$toYear,$emptyArgument,$emptyArgument,"","");
|
||||
$exportPars["HTG_N_KRED"] = array("110","10316","_","export","2","|","RETRANS Kreditorenstammsatz","RETRANS Kreditorenstammsatz",$fileNamePrefix . ".023.kred",$toDay,$toMonth,$toYear,$emptyArgument,$emptyArgument,"","");
|
||||
$exportPars["HTG_N_FZG"] = array("110","10316","_","export","3","|","RETRANS Fahrzeugstammsatz","RETRANS Fahrzeugstammsatz",$fileNamePrefix . ".023.fzg",$toDay,$toMonth,$toYear,$emptyArgument,$emptyArgument,"","");
|
||||
$exportPars["HTG_N_ABR"] = array("110","10316","_","export","5","|","RETRANS Abrechnungen","RETRANS Abrechnungen",$fileNamePrefix . ".023.abr",$toDay,$toMonth,$toYear,$emptyArgument,$emptyArgument,"","");
|
||||
$exportPars["HTG_N_GUT"] = array("110","10316","_","export","6","|","RETRANS Abrechnungen","RETRANS Abrechnungen",$fileNamePrefix . ".023.gut",$toDay,$toMonth,$toYear,$emptyArgument,$emptyArgument,"","");
|
||||
|
||||
$exportPars["HTG_S_DEB"] = array("111","10569","_","export","1","|","RETRANS Debitorenstammsatz","RETRANS Debitorenstammsatz",$fileNamePrefix . ".014.deb",$toDay,$toMonth,$toYear,$emptyArgument,$emptyArgument,"","");
|
||||
$exportPars["HTG_S_KRED"] = array("111","10569","_","export","2","|","RETRANS Kreditorenstammsatz","RETRANS Kreditorenstammsatz",$fileNamePrefix . ".014.kred",$toDay,$toMonth,$toYear,$emptyArgument,$emptyArgument,"","");
|
||||
$exportPars["HTG_S_FZG"] = array("111","10569","_","export","3","|","RETRANS Fahrzeugstammsatz","RETRANS Fahrzeugstammsatz",$fileNamePrefix . ".014.fzg",$toDay,$toMonth,$toYear,$emptyArgument,$emptyArgument,"","");
|
||||
$exportPars["HTG_S_ABR"] = array("111","10569","_","export","5","|","RETRANS Abrechnungen","RETRANS Abrechnungen",$fileNamePrefix . ".014.abr",$toDay,$toMonth,$toYear,$emptyArgument,$emptyArgument,"","");
|
||||
$exportPars["HTG_S_GUT"] = array("111","10569","_","export","6","|","RETRANS Abrechnungen","RETRANS Abrechnungen",$fileNamePrefix . ".014.gut",$toDay,$toMonth,$toYear,$emptyArgument,$emptyArgument,"","");
|
||||
|
||||
$exportPars["HTG_K_DEB"] = array("112","23403","_","export","1","|","RETRANS Debitorenstammsatz","RETRANS Debitorenstammsatz",$fileNamePrefix . ".015.deb",$toDay,$toMonth,$toYear,$emptyArgument,$emptyArgument,"","");
|
||||
$exportPars["HTG_K_KRED"] = array("112","23403","_","export","2","|","RETRANS Kreditorenstammsatz","RETRANS Kreditorenstammsatz",$fileNamePrefix . ".015.kred",$toDay,$toMonth,$toYear,$emptyArgument,$emptyArgument,"","");
|
||||
$exportPars["HTG_K_FZG"] = array("112","23403","_","export","3","|","RETRANS Fahrzeugstammsatz","RETRANS Fahrzeugstammsatz",$fileNamePrefix . ".015.fzg",$toDay,$toMonth,$toYear,$emptyArgument,$emptyArgument,"","");
|
||||
$exportPars["HTG_K_ABR"] = array("112","23403","_","export","5","|","RETRANS Abrechnungen","RETRANS Abrechnungen",$fileNamePrefix . ".015.abr",$toDay,$toMonth,$toYear,$emptyArgument,$emptyArgument,"","");
|
||||
$exportPars["HTG_K_GUT"] = array("112","23403","_","export","6","|","RETRANS Abrechnungen","RETRANS Abrechnungen",$fileNamePrefix . ".015.gut",$toDay,$toMonth,$toYear,$emptyArgument,$emptyArgument,"","");
|
||||
|
||||
$exportPars["HTG_LG_DEB"] = array("203","12573","_","export","1","|","RETRANS Debitorenstammsatz","RETRANS Debitorenstammsatz",$fileNamePrefix . ".010.deb",$toDay,$toMonth,$toYear,$emptyArgument,$emptyArgument,"","");
|
||||
$exportPars["HTG_LG_KRED"] = array("203","12573","_","export","2","|","RETRANS Kreditorenstammsatz","RETRANS Kreditorenstammsatz",$fileNamePrefix . ".010.kred",$toDay,$toMonth,$toYear,$emptyArgument,$emptyArgument,"","");
|
||||
$exportPars["HTG_LG_FZG"] = array("203","12573","_","export","3","|","RETRANS Fahrzeugstammsatz","RETRANS Fahrzeugstammsatz",$fileNamePrefix . ".010.fzg",$toDay,$toMonth,$toYear,$emptyArgument,$emptyArgument,"","");
|
||||
$exportPars["HTG_LG_ABR"] = array("203","12573","_","export","5","|","RETRANS Abrechnungen","RETRANS Abrechnungen",$fileNamePrefix . ".010.abr",$toDay,$toMonth,$toYear,$emptyArgument,$emptyArgument,"","");
|
||||
$exportPars["HTG_LG_GUT"] = array("203","12573","_","export","6","|","RETRANS Abrechnungen","RETRANS Abrechnungen",$fileNamePrefix . ".010.gut",$toDay,$toMonth,$toYear,$emptyArgument,$emptyArgument,"","");
|
||||
|
||||
$exportParsKeys = array_keys($exportPars);
|
||||
$exportParsKeysLen = count($exportParsKeys);
|
||||
if ($exportParsKeysLen != "" && is_numeric($exportParsKeysLen)) :
|
||||
|
||||
// Exports
|
||||
for ($i = 0; $i < $exportParsKeysLen; $i++) :
|
||||
|
||||
list($hq_id,$usr_id,$dummy_01,$f_act,$f_exp_category,$f_delimiter,$f_parname,$f_parname_export,$f_fileName,
|
||||
$day_to,$month_to,$year_to,$f_cs_eid_filter,$f_jbp_filter,$specialJbPayment,$jbpc_id) = $exportPars[$exportParsKeys[$i]];
|
||||
|
||||
$cmd = "php " . $path . "/export/export.php " . $passwd . " " . $hq_id . " " . $usr_id . " " . $dummy_01 . " " . $f_act . " " . $f_exp_category . " " . "\"" . $f_delimiter. "\"" . " "
|
||||
. "\"" . $f_parname . "\"" . " " . "\"" . $f_parname_export . "\"" . " " . "\"" . $f_fileName . "\"" . " " . $day_to . " " . $month_to . " " . $year_to . " "
|
||||
. $f_cs_eid_filter . " " . $f_jbp_filter . " " . $specialJbPayment . " " . $jbpc_id . " &";
|
||||
// echo $exportParsKeys[$i] . ":\n";
|
||||
// echo $cmd . "\n\n\n";
|
||||
$cmdOutput = null;
|
||||
exec($cmd, $cmdOutput);
|
||||
// list($errNo, $errDesc) = $cmdOutput;
|
||||
|
||||
$currentTime = getDateTime("0");
|
||||
writeToFile($logFile, "OP=AUTO_EXPORT|DATETIME=" . $currentTime . "|CUST=" . $exportParsKeys[$i]);
|
||||
|
||||
sleep(5); // Avoid too many tasks
|
||||
endfor;
|
||||
endif;
|
||||
endif;
|
||||
?>
|
||||
74
html/sysadmin/cron/cron_export_HTM.php
Normal file
74
html/sysadmin/cron/cron_export_HTM.php
Normal file
@@ -0,0 +1,74 @@
|
||||
<?php
|
||||
/*=======================================================================
|
||||
*
|
||||
* cron_export.php
|
||||
*
|
||||
=======================================================================*/
|
||||
|
||||
|
||||
include_once ("../include/mcglobal.inc.php");
|
||||
include_once ("../include/ftp.inc.php");
|
||||
|
||||
|
||||
if ($argv[1] == "acapella7890") :
|
||||
|
||||
// Error reporting
|
||||
error_reporting(E_ERROR | E_WARNING | E_PARSE);
|
||||
|
||||
$path = getAbsoluteSystemPath();
|
||||
$passwd = "acapella7890";
|
||||
$logFile = $path . "/log/sys_auto_export.log";
|
||||
$emptyArgument = "\"\"";
|
||||
$fileNamePrefix = substr(getDateTime("6"), 0, 12); // Format: "YmdHi"
|
||||
|
||||
if ($argv[2] == "today") :
|
||||
$toDay = getDateTime("day");
|
||||
$toMonth = getDateTime("month");
|
||||
$toYear = getDateTime("year");
|
||||
else :
|
||||
$toDay = getDateTime("day_yesterday");
|
||||
$toMonth = getDateTime("month_yesterday");
|
||||
$toYear = getDateTime("year_yesterday");
|
||||
endif;
|
||||
|
||||
|
||||
// Arguments
|
||||
// $hq_id $usr_id $dummy_01 $f_act $f_exp_category $f_delimiter $f_parname $f_parname_export $f_fileName $day_to $month_to $year_to $f_cs_eid_filter $f_jbp_filter $specialJbPayment $jbpc_id
|
||||
|
||||
$exportPars = array();
|
||||
|
||||
$exportPars["HTM_HTHH_ABR_01"] = array("1020","18086","_","export","5","|","RETRANS Abrechnungen","RETRANS Abrechnungen",substr($fileNamePrefix,0,-2) . "01" . ".101.abr",$toDay,$toMonth,$toYear,"HTHH67218",$emptyArgument,"","");
|
||||
$exportPars["HTM_HTHH_ABR_02"] = array("1020","18086","_","export","5","|","RETRANS Abrechnungen","RETRANS Abrechnungen",substr($fileNamePrefix,0,-2) . "02" . ".101.abr",$toDay,$toMonth,$toYear,"HTHH65989",$emptyArgument,"","");
|
||||
$exportPars["HTM_HTHH_ABR_03"] = array("1020","18086","_","export","5","|","RETRANS Abrechnungen","RETRANS Abrechnungen",substr($fileNamePrefix,0,-2) . "03" . ".101.abr",$toDay,$toMonth,$toYear,"HTHH69600",$emptyArgument,"","");
|
||||
|
||||
$exportPars["HTM_WAST_ABR_01"] = array("1111","18091","_","export","5","|","RETRANS Abrechnungen","RETRANS Abrechnungen",substr($fileNamePrefix,0,-2) . "01" . ".144.abr",$toDay,$toMonth,$toYear,"WAST10783",$emptyArgument,"","");
|
||||
$exportPars["HTM_WAST_ABR_02"] = array("1111","18091","_","export","5","|","RETRANS Abrechnungen","RETRANS Abrechnungen",substr($fileNamePrefix,0,-2) . "02" . ".144.abr",$toDay,$toMonth,$toYear,"WAST10972",$emptyArgument,"","");
|
||||
|
||||
|
||||
$exportParsKeys = array_keys($exportPars);
|
||||
$exportParsKeysLen = count($exportParsKeys);
|
||||
if ($exportParsKeysLen != "" && is_numeric($exportParsKeysLen)) :
|
||||
|
||||
// Exports
|
||||
for ($i = 0; $i < $exportParsKeysLen; $i++) :
|
||||
|
||||
list($hq_id,$usr_id,$dummy_01,$f_act,$f_exp_category,$f_delimiter,$f_parname,$f_parname_export,$f_fileName,
|
||||
$day_to,$month_to,$year_to,$f_cs_eid_filter,$f_jbp_filter,$specialJbPayment,$jbpc_id) = $exportPars[$exportParsKeys[$i]];
|
||||
|
||||
$cmd = "php " . $path . "/export/export.php " . $passwd . " " . $hq_id . " " . $usr_id . " " . $dummy_01 . " " . $f_act . " " . $f_exp_category . " " . "\"" . $f_delimiter. "\"" . " "
|
||||
. "\"" . $f_parname . "\"" . " " . "\"" . $f_parname_export . "\"" . " " . "\"" . $f_fileName . "\"" . " " . $day_to . " " . $month_to . " " . $year_to . " "
|
||||
. $f_cs_eid_filter . " " . $f_jbp_filter . " " . $specialJbPayment . " " . $jbpc_id . " &";
|
||||
// echo $exportParsKeys[$i] . ":\n";
|
||||
// echo $cmd . "\n\n\n";
|
||||
$cmdOutput = null;
|
||||
exec($cmd, $cmdOutput);
|
||||
// list($errNo, $errDesc) = $cmdOutput;
|
||||
|
||||
$currentTime = getDateTime("0");
|
||||
writeToFile($logFile, "OP=AUTO_EXPORT|DATETIME=" . $currentTime . "|CUST=" . $exportParsKeys[$i]);
|
||||
|
||||
sleep(5); // Avoid too many tasks
|
||||
endfor;
|
||||
endif;
|
||||
endif;
|
||||
?>
|
||||
24
html/sysadmin/cron/crontab.mps2.sav
Normal file
24
html/sysadmin/cron/crontab.mps2.sav
Normal file
@@ -0,0 +1,24 @@
|
||||
# Edit this file to introduce tasks to be run by cron.
|
||||
#
|
||||
# Each task to run has to be defined through a single line
|
||||
# indicating with different fields when the task will be run
|
||||
# and what command to run for the task
|
||||
#
|
||||
# To define the time you can provide concrete values for
|
||||
# minute (m), hour (h), day of month (dom), month (mon),
|
||||
# and day of week (dow) or use '*' in these fields (for 'any').#
|
||||
# Notice that tasks will be started based on the cron's system
|
||||
# daemon's notion of time and timezones.
|
||||
#
|
||||
# Output of the crontab jobs (including errors) is sent through
|
||||
# email to the user the crontab file belongs to (unless redirected).
|
||||
#
|
||||
# For example, you can run a backup of all your user accounts
|
||||
# at 5 a.m every week with:
|
||||
# 0 5 * * 1 tar -zcf /var/backups/home.tgz /home/
|
||||
#
|
||||
# For more information see the manual pages of crontab(5) and cron(8)
|
||||
#
|
||||
# m h dom mon dow command
|
||||
01 00 * * * php /root/votian_admin/do_bzip2.php
|
||||
00 02 * * * php /root/votian_admin/do_rsync.php
|
||||
45
html/sysadmin/cron/do_auto_export_PDF
Normal file
45
html/sysadmin/cron/do_auto_export_PDF
Normal file
@@ -0,0 +1,45 @@
|
||||
#!/bin/sh
|
||||
cd /srv/www/sb/tools/
|
||||
|
||||
php auto_export_PDF.php acapella7890 841944
|
||||
|
||||
#php auto_export_PDF.php acapella7890 831535
|
||||
#php auto_export_PDF.php acapella7890 304380
|
||||
#php auto_export_PDF.php acapella7890 304440
|
||||
#php auto_export_PDF.php acapella7890 304687
|
||||
#php auto_export_PDF.php acapella7890 304768
|
||||
#php auto_export_PDF.php acapella7890 304962
|
||||
#php auto_export_PDF.php acapella7890 305026
|
||||
#php auto_export_PDF.php acapella7890 305578
|
||||
#php auto_export_PDF.php acapella7890 305852
|
||||
#php auto_export_PDF.php acapella7890 306070
|
||||
#php auto_export_PDF.php acapella7890 305598
|
||||
#php auto_export_PDF.php acapella7890 306156
|
||||
#php auto_export_PDF.php acapella7890 306155
|
||||
#php auto_export_PDF.php acapella7890 306223
|
||||
#php auto_export_PDF.php acapella7890 306217
|
||||
#php auto_export_PDF.php acapella7890 306261
|
||||
#php auto_export_PDF.php acapella7890 305718
|
||||
#php auto_export_PDF.php acapella7890 306580
|
||||
#php auto_export_PDF.php acapella7890 306779
|
||||
#php auto_export_PDF.php acapella7890 307081
|
||||
#php auto_export_PDF.php acapella7890 307244
|
||||
#php auto_export_PDF.php acapella7890 304414
|
||||
#php auto_export_PDF.php acapella7890 307364
|
||||
#php auto_export_PDF.php acapella7890 308146
|
||||
#php auto_export_PDF.php acapella7890 305646
|
||||
#php auto_export_PDF.php acapella7890 308590
|
||||
#php auto_export_PDF.php acapella7890 317032
|
||||
#php auto_export_PDF.php acapella7890 317074
|
||||
#php auto_export_PDF.php acapella7890 306399
|
||||
#php auto_export_PDF.php acapella7890 316372
|
||||
#php auto_export_PDF.php acapella7890 316373
|
||||
#php auto_export_PDF.php acapella7890 316374
|
||||
#php auto_export_PDF.php acapella7890 316375
|
||||
#php auto_export_PDF.php acapella7890 316615
|
||||
#php auto_export_PDF.php acapella7890 316787
|
||||
#php auto_export_PDF.php acapella7890 818882
|
||||
#php auto_export_PDF.php acapella7890 823711
|
||||
#php auto_export_PDF.php acapella7890 823724
|
||||
#php auto_export_PDF.php acapella7890 824545
|
||||
#php auto_export_PDF.php acapella7890 823378
|
||||
4
html/sysadmin/cron/do_auto_export_lyreco_E
Normal file
4
html/sysadmin/cron/do_auto_export_lyreco_E
Normal file
@@ -0,0 +1,4 @@
|
||||
#!/bin/sh
|
||||
#cd /srv/www/ht/tools/
|
||||
cd /home/mps2/hansetrans/tools
|
||||
php auto_export_lyreco.php acapella7890 38174
|
||||
3
html/sysadmin/cron/do_auto_export_lyreco_N
Normal file
3
html/sysadmin/cron/do_auto_export_lyreco_N
Normal file
@@ -0,0 +1,3 @@
|
||||
#!/bin/sh
|
||||
cd /srv/www/ht/tools/
|
||||
php auto_export_lyreco.php acapella7890 33116
|
||||
4
html/sysadmin/cron/do_auto_logout_by_autorevokes
Normal file
4
html/sysadmin/cron/do_auto_logout_by_autorevokes
Normal file
@@ -0,0 +1,4 @@
|
||||
#!/bin/sh
|
||||
#cd /srv/www/sb/tools/
|
||||
cd /home/mps2/stadtbote/tools/
|
||||
php logout_cr_by_autorevokes.php acapella7890
|
||||
113
html/sysadmin/cron/do_bzip2.php
Normal file
113
html/sysadmin/cron/do_bzip2.php
Normal file
@@ -0,0 +1,113 @@
|
||||
<?php
|
||||
|
||||
date_default_timezone_set('Europe/Berlin');
|
||||
set_time_limit(0);
|
||||
error_reporting(E_ALL & ~E_NOTICE);
|
||||
$log_file_name = "/root/votian_admin/do_bzip2_" . date("Ym") . ".log";
|
||||
$srv_root = "/home/mps2";
|
||||
|
||||
doIt("/home/htdata/mysql_hha");
|
||||
doIt("/home/htdata/mysql_stadtbote1");
|
||||
//doItEdifact("$srv_root/sb/temp/edifact");
|
||||
doItLogs("$srv_root/stadtbote/log", false);
|
||||
delete_files("$srv_root/stadtbote/temp/signs");
|
||||
delete_files("$srv_root/stadtbote/temp/captchas");
|
||||
|
||||
function doIt($source) {
|
||||
$filestobezipped = array();
|
||||
$max_filemtime = 0;
|
||||
|
||||
if ($handle = opendir($source)):
|
||||
while (false !== ($file = readdir($handle))):
|
||||
if (!is_dir("$source/$file")):
|
||||
list($dirname, $basename, $extension, $filename) = array_values(pathinfo($file));
|
||||
if ($filename == "mps2-bin" && substr($extension, 0, 1) == "0"):
|
||||
$filestobezipped[] = array("$source/$file", filemtime("$source/$file"));
|
||||
$max_filemtime = (filemtime("$source/$file") > $max_filemtime ? filemtime("$source/$file") : $max_filemtime);
|
||||
endif;
|
||||
endif;
|
||||
endwhile;
|
||||
closedir($handle);
|
||||
endif;
|
||||
|
||||
foreach ($filestobezipped as $filetobezipped) {
|
||||
if ($filetobezipped[1] != $max_filemtime):
|
||||
exec_cmd("bzip2 -9 " . $filetobezipped[0]);
|
||||
endif;
|
||||
}
|
||||
}
|
||||
|
||||
//function doItEdifact($source) {
|
||||
// exec_cmd("cd $source;tar -cvf \"()_edifact_" . date("Ym") . ".tar\" --exclude=*.bz2 *;bzip2 -9f \"()_edifact_" . date("Ym") . ".tar\"");
|
||||
// if (is_file("\"()_edifact_" . date("Ym", mktime(0, 0, 0, date("m") - 2, 1, date("Y"))) . ".tar\""))
|
||||
// exec_cmd("rm \"()_edifact_" . date("Ym", mktime(0, 0, 0, date("m") - 2, 1, date("Y"))) . ".tar\"");
|
||||
//
|
||||
// $filestoberemoved = array();
|
||||
// if ($handle = opendir($source)):
|
||||
// while (false !== ($file = readdir($handle))):
|
||||
// if (!is_dir("$source/$file")):
|
||||
// list($dirname, $basename, $extension, $filename) = array_values(pathinfo($file));
|
||||
// if (filemtime("$source/$file") < mktime(0, 0, 0, date("m"), 1, date("Y")) && $extension != "bz2"):
|
||||
// $filestoberemoved[] = "$source/$file";
|
||||
// endif;
|
||||
// endif;
|
||||
// endwhile;
|
||||
// closedir($handle);
|
||||
// endif;
|
||||
//
|
||||
// foreach ($filestoberemoved as $filetoberemoved) {
|
||||
// exec_cmd("rm \"" . $filetoberemoved . "\"");
|
||||
// }
|
||||
//}
|
||||
|
||||
function doItLogs($source, $do_delete = false) {
|
||||
$filestoberemoved = array();
|
||||
$filestobezipped = array();
|
||||
|
||||
if ($handle = opendir($source)):
|
||||
while (false !== ($file = readdir($handle))):
|
||||
if (!is_dir("$source/$file")):
|
||||
list($dirname, $basename, $extension, $filename) = array_values(pathinfo($file));
|
||||
if (!(strpos($basename, "_" . date("Ym", mktime(0, 0, 0, date("m") - 1, 1, date("Y")))) === false) && $extension == "log"):
|
||||
$filestobezipped[] = "$source/$file";
|
||||
elseif (!(strpos($basename, "_" . date("Ym", mktime(0, 0, 0, date("m") - 2, 1, date("Y")))) === false) && $extension == "bz2"):
|
||||
$filestoberemoved[] = "$source/$file";
|
||||
endif;
|
||||
endif;
|
||||
endwhile;
|
||||
closedir($handle);
|
||||
endif;
|
||||
|
||||
if ($do_delete)
|
||||
foreach ($filestoberemoved as $filetoberemoved) {
|
||||
exec_cmd("rm " . $filetoberemoved);
|
||||
}
|
||||
foreach ($filestobezipped as $filetobezipped) {
|
||||
exec_cmd("bzip2 -9 " . $filetobezipped);
|
||||
}
|
||||
}
|
||||
|
||||
function delete_files($filespec){
|
||||
// exec_cmd("ls $filespec | xargs rm");
|
||||
exec_cmd("find $filespec -type f -delete");
|
||||
}
|
||||
|
||||
function exec_cmd($cmd){
|
||||
global $log_file_name;
|
||||
|
||||
$cmd .= " >> $log_file_name 2>&1";
|
||||
writeLog("\"$cmd\"");
|
||||
exec($cmd);
|
||||
}
|
||||
|
||||
function writeLog($log_text)
|
||||
{
|
||||
global $log_file_name;
|
||||
|
||||
$fileHandle = @fopen($log_file_name, 'a');
|
||||
@fwrite($fileHandle, "[" . date("Y-m-d H:i:s") . "] " . $log_text . "\n");
|
||||
@fclose($fileHandle);
|
||||
return;
|
||||
}
|
||||
|
||||
?>
|
||||
3
html/sysadmin/cron/do_check_jb_permanent_moebel
Normal file
3
html/sysadmin/cron/do_check_jb_permanent_moebel
Normal file
@@ -0,0 +1,3 @@
|
||||
#!/bin/sh
|
||||
cd /srv/www/mps1/moebel/jobs
|
||||
php check_jb_permanent.php >> /srv/www/mps1/moebel/log/check_jb_permanent_`date +%Y``date +%m`.log 2>&1
|
||||
4
html/sysadmin/cron/do_cronOrderReqSendCsv
Normal file
4
html/sysadmin/cron/do_cronOrderReqSendCsv
Normal file
@@ -0,0 +1,4 @@
|
||||
#!/bin/sh
|
||||
cd /srv/www/htm/tools/
|
||||
php cronOrderReqSendCsv.php acapella7890 >> /srv/www/htm/log/cronOrderReqSendCsv_`date +%Y``date +%m`.log 2>&1
|
||||
|
||||
4
html/sysadmin/cron/do_cron_FTP_upload_HTG
Normal file
4
html/sysadmin/cron/do_cron_FTP_upload_HTG
Normal file
@@ -0,0 +1,4 @@
|
||||
#!/bin/sh
|
||||
#cd /srv/www/ht/tools/
|
||||
cd /home/mps2/hansetrans/tools
|
||||
php cron_FTP_upload_HTG.php acapella7890
|
||||
3
html/sysadmin/cron/do_cron_FTP_upload_HTM
Normal file
3
html/sysadmin/cron/do_cron_FTP_upload_HTM
Normal file
@@ -0,0 +1,3 @@
|
||||
#!/bin/sh
|
||||
cd /srv/www/htm/tools/
|
||||
php cron_FTP_upload_HTM.php acapella7890
|
||||
3
html/sysadmin/cron/do_cron_HTG_Kennziffer_95
Normal file
3
html/sysadmin/cron/do_cron_HTG_Kennziffer_95
Normal file
@@ -0,0 +1,3 @@
|
||||
#!/bin/sh
|
||||
cd /srv/www/ht/tools/
|
||||
php auto_trigger_check_metafield_mtfk_1649_OLD.php acapella7890 HQ_ALL
|
||||
62
html/sysadmin/cron/do_cron_HTG_MAILS
Normal file
62
html/sysadmin/cron/do_cron_HTG_MAILS
Normal file
@@ -0,0 +1,62 @@
|
||||
#!/bin/sh
|
||||
cd /srv/www/ht/tools/
|
||||
|
||||
# EG-LIZENZ
|
||||
php auto_trigger_check_metafield_mtfk_1629.php acapella7890 101
|
||||
php auto_trigger_check_metafield_mtfk_1629.php acapella7890 102
|
||||
php auto_trigger_check_metafield_mtfk_1629.php acapella7890 103
|
||||
php auto_trigger_check_metafield_mtfk_1629.php acapella7890 104
|
||||
php auto_trigger_check_metafield_mtfk_1629.php acapella7890 105
|
||||
php auto_trigger_check_metafield_mtfk_1629.php acapella7890 106
|
||||
php auto_trigger_check_metafield_mtfk_1629.php acapella7890 107
|
||||
php auto_trigger_check_metafield_mtfk_1629.php acapella7890 108
|
||||
php auto_trigger_check_metafield_mtfk_1629.php acapella7890 109
|
||||
php auto_trigger_check_metafield_mtfk_1629.php acapella7890 110
|
||||
php auto_trigger_check_metafield_mtfk_1629.php acapella7890 111
|
||||
php auto_trigger_check_metafield_mtfk_1629.php acapella7890 112
|
||||
php auto_trigger_check_metafield_mtfk_1629.php acapella7890 HQ_ALL
|
||||
|
||||
# KENNZIFFER 95
|
||||
php auto_trigger_check_metafield_mtfk_1650.php acapella7890 101
|
||||
php auto_trigger_check_metafield_mtfk_1650.php acapella7890 102
|
||||
php auto_trigger_check_metafield_mtfk_1650.php acapella7890 103
|
||||
php auto_trigger_check_metafield_mtfk_1650.php acapella7890 104
|
||||
php auto_trigger_check_metafield_mtfk_1650.php acapella7890 105
|
||||
php auto_trigger_check_metafield_mtfk_1650.php acapella7890 106
|
||||
php auto_trigger_check_metafield_mtfk_1650.php acapella7890 107
|
||||
php auto_trigger_check_metafield_mtfk_1650.php acapella7890 108
|
||||
php auto_trigger_check_metafield_mtfk_1650.php acapella7890 109
|
||||
php auto_trigger_check_metafield_mtfk_1650.php acapella7890 110
|
||||
php auto_trigger_check_metafield_mtfk_1650.php acapella7890 111
|
||||
php auto_trigger_check_metafield_mtfk_1650.php acapella7890 112
|
||||
php auto_trigger_check_metafield_mtfk_1650.php acapella7890 HQ_ALL
|
||||
|
||||
# UN-Jahresgespräch
|
||||
php auto_trigger_check_metafield_mtfk_1652.php acapella7890 101
|
||||
php auto_trigger_check_metafield_mtfk_1652.php acapella7890 102
|
||||
php auto_trigger_check_metafield_mtfk_1652.php acapella7890 103
|
||||
php auto_trigger_check_metafield_mtfk_1652.php acapella7890 104
|
||||
php auto_trigger_check_metafield_mtfk_1652.php acapella7890 105
|
||||
php auto_trigger_check_metafield_mtfk_1652.php acapella7890 106
|
||||
php auto_trigger_check_metafield_mtfk_1652.php acapella7890 107
|
||||
php auto_trigger_check_metafield_mtfk_1652.php acapella7890 108
|
||||
php auto_trigger_check_metafield_mtfk_1652.php acapella7890 109
|
||||
php auto_trigger_check_metafield_mtfk_1652.php acapella7890 110
|
||||
php auto_trigger_check_metafield_mtfk_1652.php acapella7890 111
|
||||
php auto_trigger_check_metafield_mtfk_1652.php acapella7890 112
|
||||
php auto_trigger_check_metafield_mtfk_1652.php acapella7890 HQ_ALL
|
||||
|
||||
# Vorort-Prüfung
|
||||
php tool_vop.php acapella7890 101
|
||||
php tool_vop.php acapella7890 102
|
||||
php tool_vop.php acapella7890 103
|
||||
php tool_vop.php acapella7890 104
|
||||
php tool_vop.php acapella7890 105
|
||||
php tool_vop.php acapella7890 106
|
||||
php tool_vop.php acapella7890 107
|
||||
php tool_vop.php acapella7890 108
|
||||
php tool_vop.php acapella7890 109
|
||||
php tool_vop.php acapella7890 110
|
||||
php tool_vop.php acapella7890 111
|
||||
php tool_vop.php acapella7890 112
|
||||
php tool_vop.php acapella7890 HQ_ALL
|
||||
39
html/sysadmin/cron/do_cron_HTG_STATISTIC_SPECIAL
Normal file
39
html/sysadmin/cron/do_cron_HTG_STATISTIC_SPECIAL
Normal file
@@ -0,0 +1,39 @@
|
||||
#!/bin/sh
|
||||
cd /srv/www/ht/tools/
|
||||
|
||||
# GFL
|
||||
# php statistic_special_GFL.php acapella7890
|
||||
|
||||
# Alle Niederlassungen aufrufen
|
||||
# *** ERSTMAL ZUM TEST NUR HH ***
|
||||
# php statistic_special_NL.php acapella7890 101
|
||||
# php statistic_special_NL.php acapella7890 102
|
||||
# php statistic_special_NL.php acapella7890 103
|
||||
# php statistic_special_NL.php acapella7890 104
|
||||
# php statistic_special_NL.php acapella7890 105
|
||||
# php statistic_special_NL.php acapella7890 106
|
||||
# php statistic_special_NL.php acapella7890 107
|
||||
# php statistic_special_NL.php acapella7890 108
|
||||
# php statistic_special_NL.php acapella7890 109
|
||||
# php statistic_special_NL.php acapella7890 110
|
||||
# php statistic_special_NL.php acapella7890 111
|
||||
# php statistic_special_NL.php acapella7890 112
|
||||
|
||||
# EXTRA: Iteration über aller NLn-Übersichten für GFL
|
||||
# php statistic_special_NL_MULTI.php acapella7890
|
||||
|
||||
# Neue Version
|
||||
php statistic_special_NL_NEW.php acapella7890
|
||||
php statistic_special_NL_NEW.php acapella7890 101
|
||||
php statistic_special_NL_NEW.php acapella7890 102
|
||||
php statistic_special_NL_NEW.php acapella7890 103
|
||||
php statistic_special_NL_NEW.php acapella7890 104
|
||||
php statistic_special_NL_NEW.php acapella7890 105
|
||||
php statistic_special_NL_NEW.php acapella7890 106
|
||||
php statistic_special_NL_NEW.php acapella7890 107
|
||||
php statistic_special_NL_NEW.php acapella7890 108
|
||||
php statistic_special_NL_NEW.php acapella7890 109
|
||||
php statistic_special_NL_NEW.php acapella7890 110
|
||||
php statistic_special_NL_NEW.php acapella7890 111
|
||||
php statistic_special_NL_NEW.php acapella7890 112
|
||||
php statistic_special_NL_NEW.php acapella7890 203
|
||||
155
html/sysadmin/cron/do_cron_STB_MAILS
Normal file
155
html/sysadmin/cron/do_cron_STB_MAILS
Normal file
@@ -0,0 +1,155 @@
|
||||
#!/bin/sh
|
||||
cd /home/mps2/stadtbote/tools
|
||||
|
||||
# 2. Seite TRANSPORTEUR und 2. Seite FAHRZEUG
|
||||
# php auto_trigger_check_metafield.php acapella7890 1
|
||||
# php auto_trigger_check_metafield.php acapella7890 2
|
||||
# php auto_trigger_check_metafield.php acapella7890 3
|
||||
# php auto_trigger_check_metafield.php acapella7890 4
|
||||
# php auto_trigger_check_metafield.php acapella7890 5
|
||||
# php auto_trigger_check_metafield.php acapella7890 6
|
||||
# php auto_trigger_check_metafield.php acapella7890 7
|
||||
# php auto_trigger_check_metafield.php acapella7890 8
|
||||
# php auto_trigger_check_metafield.php acapella7890 9
|
||||
# php auto_trigger_check_metafield.php acapella7890 10
|
||||
# php auto_trigger_check_metafield.php acapella7890 11
|
||||
# php auto_trigger_check_metafield.php acapella7890 90
|
||||
# php auto_trigger_check_metafield.php acapella7890 HQ_ALL
|
||||
|
||||
# PBSG-FILTER
|
||||
php auto_trigger_check_metafield_mtfk_1710.php acapella7890 1
|
||||
php auto_trigger_check_metafield_mtfk_1710.php acapella7890 2
|
||||
php auto_trigger_check_metafield_mtfk_1710.php acapella7890 3
|
||||
php auto_trigger_check_metafield_mtfk_1710.php acapella7890 4
|
||||
php auto_trigger_check_metafield_mtfk_1710.php acapella7890 5
|
||||
php auto_trigger_check_metafield_mtfk_1710.php acapella7890 6
|
||||
php auto_trigger_check_metafield_mtfk_1710.php acapella7890 7
|
||||
php auto_trigger_check_metafield_mtfk_1710.php acapella7890 8
|
||||
php auto_trigger_check_metafield_mtfk_1710.php acapella7890 9
|
||||
php auto_trigger_check_metafield_mtfk_1710.php acapella7890 10
|
||||
php auto_trigger_check_metafield_mtfk_1710.php acapella7890 11
|
||||
# php auto_trigger_check_metafield_mtfk_1710.php acapella7890 90
|
||||
# php auto_trigger_check_metafield_mtfk_1710.php acapella7890 HQ_ALL
|
||||
|
||||
# Führerscheinablaufdatum
|
||||
php auto_trigger_check_metafield_mtfk_1623.php acapella7890 1
|
||||
php auto_trigger_check_metafield_mtfk_1623.php acapella7890 2
|
||||
php auto_trigger_check_metafield_mtfk_1623.php acapella7890 3
|
||||
php auto_trigger_check_metafield_mtfk_1623.php acapella7890 4
|
||||
php auto_trigger_check_metafield_mtfk_1623.php acapella7890 5
|
||||
php auto_trigger_check_metafield_mtfk_1623.php acapella7890 6
|
||||
php auto_trigger_check_metafield_mtfk_1623.php acapella7890 7
|
||||
php auto_trigger_check_metafield_mtfk_1623.php acapella7890 8
|
||||
php auto_trigger_check_metafield_mtfk_1623.php acapella7890 9
|
||||
php auto_trigger_check_metafield_mtfk_1623.php acapella7890 10
|
||||
php auto_trigger_check_metafield_mtfk_1623.php acapella7890 11
|
||||
# php auto_trigger_check_metafield_mtfk_1623.php acapella7890 90
|
||||
# php auto_trigger_check_metafield_mtfk_1623.php acapella7890 HQ_ALL
|
||||
|
||||
# Mindestlohngesetz Nachhaltungsdatum
|
||||
php auto_trigger_check_metafield_mtfk_1715.php acapella7890 8
|
||||
|
||||
# Corona-Impfung
|
||||
php auto_trigger_check_metafield_mtfk_1717.php acapella7890 1
|
||||
php auto_trigger_check_metafield_mtfk_1717.php acapella7890 2
|
||||
php auto_trigger_check_metafield_mtfk_1717.php acapella7890 3
|
||||
php auto_trigger_check_metafield_mtfk_1717.php acapella7890 4
|
||||
php auto_trigger_check_metafield_mtfk_1717.php acapella7890 5
|
||||
php auto_trigger_check_metafield_mtfk_1717.php acapella7890 6
|
||||
php auto_trigger_check_metafield_mtfk_1717.php acapella7890 7
|
||||
php auto_trigger_check_metafield_mtfk_1717.php acapella7890 8
|
||||
php auto_trigger_check_metafield_mtfk_1717.php acapella7890 9
|
||||
php auto_trigger_check_metafield_mtfk_1717.php acapella7890 10
|
||||
php auto_trigger_check_metafield_mtfk_1717.php acapella7890 11
|
||||
# php auto_trigger_check_metafield_mtfk_1717.php acapella7890 90
|
||||
# php auto_trigger_check_metafield_mtfk_1717.php acapella7890 HQ_ALL
|
||||
|
||||
# FZ-Führungszeugnis
|
||||
php auto_trigger_check_metafield_mtfk_1718.php acapella7890 1
|
||||
php auto_trigger_check_metafield_mtfk_1718.php acapella7890 2
|
||||
php auto_trigger_check_metafield_mtfk_1718.php acapella7890 3
|
||||
php auto_trigger_check_metafield_mtfk_1718.php acapella7890 4
|
||||
php auto_trigger_check_metafield_mtfk_1718.php acapella7890 5
|
||||
php auto_trigger_check_metafield_mtfk_1718.php acapella7890 6
|
||||
php auto_trigger_check_metafield_mtfk_1718.php acapella7890 7
|
||||
php auto_trigger_check_metafield_mtfk_1718.php acapella7890 8
|
||||
php auto_trigger_check_metafield_mtfk_1718.php acapella7890 9
|
||||
php auto_trigger_check_metafield_mtfk_1718.php acapella7890 10
|
||||
php auto_trigger_check_metafield_mtfk_1718.php acapella7890 11
|
||||
# php auto_trigger_check_metafield_mtfk_1718.php acapella7890 90
|
||||
# php auto_trigger_check_metafield_mtfk_1718.php acapella7890 HQ_ALL
|
||||
|
||||
# Good Distribution Practice
|
||||
php auto_trigger_check_metafield_mtfk_1719.php acapella7890 1
|
||||
php auto_trigger_check_metafield_mtfk_1719.php acapella7890 2
|
||||
php auto_trigger_check_metafield_mtfk_1719.php acapella7890 3
|
||||
php auto_trigger_check_metafield_mtfk_1719.php acapella7890 4
|
||||
php auto_trigger_check_metafield_mtfk_1719.php acapella7890 5
|
||||
php auto_trigger_check_metafield_mtfk_1719.php acapella7890 6
|
||||
php auto_trigger_check_metafield_mtfk_1719.php acapella7890 7
|
||||
php auto_trigger_check_metafield_mtfk_1719.php acapella7890 8
|
||||
php auto_trigger_check_metafield_mtfk_1719.php acapella7890 9
|
||||
php auto_trigger_check_metafield_mtfk_1719.php acapella7890 10
|
||||
php auto_trigger_check_metafield_mtfk_1719.php acapella7890 11
|
||||
# php auto_trigger_check_metafield_mtfk_1719.php acapella7890 90
|
||||
# php auto_trigger_check_metafield_mtfk_1719.php acapella7890 HQ_ALL
|
||||
|
||||
# EG-LIZENZ
|
||||
# php auto_trigger_check_metafield_mtfk_1629.php acapella7890 1
|
||||
# php auto_trigger_check_metafield_mtfk_1629.php acapella7890 2
|
||||
# php auto_trigger_check_metafield_mtfk_1629.php acapella7890 3
|
||||
# php auto_trigger_check_metafield_mtfk_1629.php acapella7890 4
|
||||
# php auto_trigger_check_metafield_mtfk_1629.php acapella7890 5
|
||||
# php auto_trigger_check_metafield_mtfk_1629.php acapella7890 6
|
||||
# php auto_trigger_check_metafield_mtfk_1629.php acapella7890 7
|
||||
# php auto_trigger_check_metafield_mtfk_1629.php acapella7890 8
|
||||
# php auto_trigger_check_metafield_mtfk_1629.php acapella7890 9
|
||||
# php auto_trigger_check_metafield_mtfk_1629.php acapella7890 10
|
||||
# php auto_trigger_check_metafield_mtfk_1629.php acapella7890 11
|
||||
# php auto_trigger_check_metafield_mtfk_1629.php acapella7890 90
|
||||
# php auto_trigger_check_metafield_mtfk_1629.php acapella7890 HQ_ALL
|
||||
|
||||
# KENNZIFFER 95
|
||||
# php auto_trigger_check_metafield_mtfk_1650.php acapella7890 1
|
||||
# php auto_trigger_check_metafield_mtfk_1650.php acapella7890 2
|
||||
# php auto_trigger_check_metafield_mtfk_1650.php acapella7890 3
|
||||
# php auto_trigger_check_metafield_mtfk_1650.php acapella7890 4
|
||||
# php auto_trigger_check_metafield_mtfk_1650.php acapella7890 5
|
||||
# php auto_trigger_check_metafield_mtfk_1650.php acapella7890 6
|
||||
# php auto_trigger_check_metafield_mtfk_1650.php acapella7890 7
|
||||
# php auto_trigger_check_metafield_mtfk_1650.php acapella7890 8
|
||||
# php auto_trigger_check_metafield_mtfk_1650.php acapella7890 9
|
||||
# php auto_trigger_check_metafield_mtfk_1650.php acapella7890 10
|
||||
# php auto_trigger_check_metafield_mtfk_1650.php acapella7890 11
|
||||
# php auto_trigger_check_metafield_mtfk_1650.php acapella7890 90
|
||||
# php auto_trigger_check_metafield_mtfk_1650.php acapella7890 HQ_ALL
|
||||
|
||||
# UN-Jahresgespräch
|
||||
# php auto_trigger_check_metafield_mtfk_1652.php acapella7890 1
|
||||
# php auto_trigger_check_metafield_mtfk_1652.php acapella7890 2
|
||||
# php auto_trigger_check_metafield_mtfk_1652.php acapella7890 3
|
||||
# php auto_trigger_check_metafield_mtfk_1652.php acapella7890 4
|
||||
# php auto_trigger_check_metafield_mtfk_1652.php acapella7890 5
|
||||
# php auto_trigger_check_metafield_mtfk_1652.php acapella7890 6
|
||||
# php auto_trigger_check_metafield_mtfk_1652.php acapella7890 7
|
||||
# php auto_trigger_check_metafield_mtfk_1652.php acapella7890 8
|
||||
# php auto_trigger_check_metafield_mtfk_1652.php acapella7890 9
|
||||
# php auto_trigger_check_metafield_mtfk_1652.php acapella7890 10
|
||||
# php auto_trigger_check_metafield_mtfk_1652.php acapella7890 11
|
||||
# php auto_trigger_check_metafield_mtfk_1652.php acapella7890 90
|
||||
# php auto_trigger_check_metafield_mtfk_1652.php acapella7890 HQ_ALL
|
||||
|
||||
# Vorort-Prüfung
|
||||
# php tool_vop.php acapella7890 1
|
||||
# php tool_vop.php acapella7890 2
|
||||
# php tool_vop.php acapella7890 3
|
||||
# php tool_vop.php acapella7890 4
|
||||
# php tool_vop.php acapella7890 5
|
||||
# php tool_vop.php acapella7890 6
|
||||
# php tool_vop.php acapella7890 7
|
||||
# php tool_vop.php acapella7890 8
|
||||
# php tool_vop.php acapella7890 9
|
||||
# php tool_vop.php acapella7890 10
|
||||
# php tool_vop.php acapella7890 11
|
||||
# php tool_vop.php acapella7890 90
|
||||
# php tool_vop.php acapella7890 HQ_ALL
|
||||
6
html/sysadmin/cron/do_cron_export_HHA
Normal file
6
html/sysadmin/cron/do_cron_export_HHA
Normal file
@@ -0,0 +1,6 @@
|
||||
#!/bin/sh
|
||||
cd /home/mps2/hha/export/
|
||||
|
||||
php cron_export_HHA.php acapella7890 101
|
||||
php cron_export_HHA.php acapella7890 102
|
||||
php cron_export_HHA.php acapella7890 103
|
||||
4
html/sysadmin/cron/do_cron_export_HTG
Normal file
4
html/sysadmin/cron/do_cron_export_HTG
Normal file
@@ -0,0 +1,4 @@
|
||||
#!/bin/sh
|
||||
#cd /srv/www/ht/tools/
|
||||
cd /home/mps2/hansetrans/tools
|
||||
php cron_export_HTG.php acapella7890 today
|
||||
3
html/sysadmin/cron/do_cron_export_HTM
Normal file
3
html/sysadmin/cron/do_cron_export_HTM
Normal file
@@ -0,0 +1,3 @@
|
||||
#!/bin/sh
|
||||
cd /srv/www/htm/tools/
|
||||
php cron_export_HTM.php acapella7890 today
|
||||
3
html/sysadmin/cron/do_cron_export_SB
Normal file
3
html/sysadmin/cron/do_cron_export_SB
Normal file
@@ -0,0 +1,3 @@
|
||||
#!/bin/sh
|
||||
cd /home/mps2/stadtbote/tools
|
||||
php cron_export_SB.php acapella7890 today
|
||||
5
html/sysadmin/cron/do_cron_monitor_replication
Normal file
5
html/sysadmin/cron/do_cron_monitor_replication
Normal file
@@ -0,0 +1,5 @@
|
||||
#!/bin/sh
|
||||
#cd /srv/www/htm/sysadmin/
|
||||
cd /home/mps2/htm/sysadmin
|
||||
php cron_monitor_replication.php acapella7890 >> /home/mps2/htm/log/cron_monitor_replication_`date +%Y``date +%m`.log 2>&1
|
||||
php cron_monitor_replication_NEW.php acapella7890 >> /home/mps2/htm/log/cron_monitor_replication_`date +%Y``date +%m`.log 2>&1
|
||||
8
html/sysadmin/cron/do_cron_soap_0
Normal file
8
html/sysadmin/cron/do_cron_soap_0
Normal file
@@ -0,0 +1,8 @@
|
||||
#!/bin/sh
|
||||
#cd /srv/www/mps1/hha/import/
|
||||
cd /home/mps2/hha/import/
|
||||
php soap.php acapella7890 1 0
|
||||
#cd /srv/www/mps1/hha_test/import/
|
||||
cd /home/mps2/hha_test/import/
|
||||
php soap.php acapella7890 1 0
|
||||
|
||||
7
html/sysadmin/cron/do_cron_soap_1
Normal file
7
html/sysadmin/cron/do_cron_soap_1
Normal file
@@ -0,0 +1,7 @@
|
||||
#!/bin/sh
|
||||
#cd /srv/www/mps1/hha/import/
|
||||
cd /home/mps2/hha/import/
|
||||
php soap.php acapella7890 1 1
|
||||
#cd /srv/www/mps1/hha_test/import/
|
||||
cd /home/mps2/hha_test/import/
|
||||
php soap.php acapella7890 1 1
|
||||
6
html/sysadmin/cron/do_cron_special_HHA
Normal file
6
html/sysadmin/cron/do_cron_special_HHA
Normal file
@@ -0,0 +1,6 @@
|
||||
#!/bin/sh
|
||||
cd /home/mps2/hha/illt/
|
||||
|
||||
php cron_special_HHA.php acapella7890
|
||||
|
||||
|
||||
10
html/sysadmin/cron/do_cron_vht_dispo_days_HHA
Normal file
10
html/sysadmin/cron/do_cron_vht_dispo_days_HHA
Normal file
@@ -0,0 +1,10 @@
|
||||
#!/bin/sh
|
||||
#cd /srv/www/mps1/hha/include/
|
||||
cd /home/mps2/hha/include/
|
||||
php ../include/cron_vht_dispo_days_HHA.php >> ../log/cron_vht_dispo_days_HHA_`date +%Y-%m`.log
|
||||
#cd /srv/www/mps1/hha_test/include/
|
||||
cd /home/mps2/hha_test/include/
|
||||
php ../include/cron_vht_dispo_days_HHA.php >> ../log/cron_vht_dispo_days_HHA_`date +%Y-%m`.log
|
||||
##cd /srv/www/mps1/hha_test_intern/include/
|
||||
#cd /home/mps2/hha_test_intern_include/include/
|
||||
#php ../include/cron_vht_dispo_days_HHA.php >> ../log/cron_vht_dispo_days_HHA_`date +%Y-%m`.log
|
||||
91
html/sysadmin/cron/do_rsync
Normal file
91
html/sysadmin/cron/do_rsync
Normal file
@@ -0,0 +1,91 @@
|
||||
#!/bin/sh
|
||||
log_file="/root/votian_admin/do_rsync_`date +%Y``date +%m`.log"
|
||||
|
||||
# rsync LN (started on 26.02.2021)
|
||||
rsync -e ssh -avz root@172.16.0.147:/srv/htdocs/services/LN_LIVE/*.php /home/mps2/stadtbote/service/LN_374893028394/ >> ${log_file} 2>&1
|
||||
rsync -e ssh -avz /home/mps2/stadtbote/service/LN_374893028394/*.txt root@172.16.0.147:/srv/htdocs/services/LN_LIVE/ >> ${log_file} 2>&1
|
||||
|
||||
## rsync photos (stopped on 05.04.2016)
|
||||
#rsync -e ssh -avz --exclude=htg_pics --delete --bwlimit=5000 root@172.16.0.104:/home/retrans/ftp/mbl_foto/ /srv/www/htm/documents/photos/ >> ${log_file} 2>&1
|
||||
#echo [`date +%F" "%X" "%Z`] rsync finished >> ${log_file}
|
||||
|
||||
## restart check_jb_permanent.1000.php if not running
|
||||
# not needed any longer: disabled on 2017-12-31
|
||||
#check_jb_permanent_found="false"
|
||||
#for php_pid in `pidof php`
|
||||
#do
|
||||
# check_jb_permanent_pid=`ps $php_pid | grep check_jb_permanent.1000.php`
|
||||
# if [ "$check_jb_permanent_pid" != "" ]; then
|
||||
# check_jb_permanent_found="true"
|
||||
# fi
|
||||
#done
|
||||
#if [ "$check_jb_permanent_found" != "true" ]; then
|
||||
# cd /srv/www/htm/jobs
|
||||
# php /srv/www/htm/jobs/check_jb_permanent.1000.php >> ../log/check_jb_permanent.1000.err 2>&1 &
|
||||
# echo [`date +%F" "%X" "%Z`] check_jb_permanent.1000.php restarted >> ${log_file}
|
||||
#fi
|
||||
|
||||
# restart check_jb_permanent.auto.php if not running
|
||||
check_jb_permanent_found="false"
|
||||
for php_pid in `pidof php`
|
||||
do
|
||||
check_jb_permanent_pid=`ps $php_pid | grep check_jb_permanent.auto.php`
|
||||
if [ "$check_jb_permanent_pid" != "" ]; then
|
||||
check_jb_permanent_found="true"
|
||||
fi
|
||||
done
|
||||
#if [ "$check_jb_permanent_found" != "true" ]; then
|
||||
# cd /home/mps2/stadtbote_auto/jobs
|
||||
# php /home/mps2/stadtbote_auto/jobs/check_jb_permanent.auto.php >> ../log/check_jb_permanent.auto.err 2>&1 &
|
||||
# echo [`date +%F" "%X" "%Z`] check_jb_permanent.auto.php restarted >> ${log_file}
|
||||
#fi
|
||||
if [ "$check_jb_permanent_found" != "true" ]; then
|
||||
cd /home/mps2/stadtbote/jobs
|
||||
php /home/mps2/stadtbote/jobs/check_jb_permanent.auto.php >> ../log/check_jb_permanent.auto.err 2>&1 &
|
||||
echo [`date +%F" "%X" "%Z`] check_jb_permanent.auto.php restarted >> ${log_file}
|
||||
fi
|
||||
|
||||
# restart check_jb_permanent.auto.service.php if not running
|
||||
check_jb_permanent_found="false"
|
||||
for php_pid in `pidof php`
|
||||
do
|
||||
check_jb_permanent_pid=`ps $php_pid | grep check_jb_permanent.auto.service.php`
|
||||
if [ "$check_jb_permanent_pid" != "" ]; then
|
||||
check_jb_permanent_found="true"
|
||||
fi
|
||||
done
|
||||
if [ "$check_jb_permanent_found" != "true" ]; then
|
||||
cd /home/mps2/stadtbote/jobs
|
||||
php /home/mps2/stadtbote/jobs/check_jb_permanent.auto.service.php >> ../log/check_jb_permanent.auto.service.err 2>&1 &
|
||||
echo [`date +%F" "%X" "%Z`] check_jb_permanent.auto.service.php restarted >> ${log_file}
|
||||
fi
|
||||
|
||||
## restart check_jb_permanent.auto_test.php if not running
|
||||
#check_jb_permanent_found="false"
|
||||
#for php_pid in `pidof php`
|
||||
#do
|
||||
# check_jb_permanent_pid=`ps $php_pid | grep check_jb_permanent.auto_test.php`
|
||||
# if [ "$check_jb_permanent_pid" != "" ]; then
|
||||
# check_jb_permanent_found="true"
|
||||
# fi
|
||||
#done
|
||||
#if [ "$check_jb_permanent_found" != "true" ]; then
|
||||
# cd /home/mps2/test_sb/jobs
|
||||
# php /home/mps2/test_sb/jobs/check_jb_permanent.auto_test.php >> ../log/check_jb_permanent.auto_test.err 2>&1 &
|
||||
# echo [`date +%F" "%X" "%Z`] check_jb_permanent.auto_test.php restarted >> ${log_file}
|
||||
#fi
|
||||
|
||||
## restart automailer_cfm_main.php if not running
|
||||
#check_jb_permanent_found="false"
|
||||
#for php_pid in `pidof php`
|
||||
#do
|
||||
# check_jb_permanent_pid=`ps $php_pid | grep automailer_cfm_main.php`
|
||||
# if [ "$check_jb_permanent_pid" != "" ]; then
|
||||
# check_jb_permanent_found="true"
|
||||
# fi
|
||||
#done
|
||||
#if [ "$check_jb_permanent_found" != "true" ]; then
|
||||
# cd /home/mps2/test_cfm/include
|
||||
# php /home/mps2/test_cfm/include/automailer_cfm_main.php >> ../log/automailer_cfm_main.err 2>&1 &
|
||||
# echo [`date +%F" "%X" "%Z`] automailer_cfm_main.php restarted >> ${log_file}
|
||||
#fi
|
||||
31
html/sysadmin/cron/do_rsync.php
Normal file
31
html/sysadmin/cron/do_rsync.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
date_default_timezone_set('Europe/Berlin');
|
||||
set_time_limit(0);
|
||||
|
||||
exec_cmd("rsync -e ssh -avz --bwlimit=5000 --exclude=temp/captchas --exclude=temp/signs --exclude=temp/photos root@172.16.0.122:/srv/www/sb/* /home/mps2/stadtbote/");
|
||||
exec_cmd("rsync -e ssh -avz --bwlimit=5000 --exclude=temp/captchas --exclude=temp/signs --exclude=temp/photos root@172.16.0.122:/srv/www/ht/* /home/mps2/hansetrans/");
|
||||
//exec_cmd("rsync -e ssh -avz --bwlimit=5000 --exclude=temp/captchas --exclude=temp/signs --exclude=temp/download --exclude=import/upload/HTM/mobile_pics root@172.16.0.122:/srv/www/htm/* /home/mps2/htm/");
|
||||
// 08.04.2016: Option "--exclude=documents/photos" wurde enfernt
|
||||
exec_cmd("rsync -e ssh -avz --bwlimit=5000 root@172.16.0.122:/srv/www/mps1/intern/ /home/mps2/intern/");
|
||||
exec_cmd("rsync -e ssh -avz --bwlimit=5000 root@172.16.0.122:/srv/www/mps1/timetracker/ /home/mps2/timetracker/");
|
||||
//exec_cmd("rsync -e ssh -avz --bwlimit=5000 root@172.16.0.122:/srv/www/mps1/stadtbote_auto/ /home/mps2/stadtbote_auto/");
|
||||
//exec_cmd("rsync -e ssh -avz --bwlimit=5000 root@172.16.0.122:/srv/www/mps1/moebel/ /home/mps2/moebel/");
|
||||
exec_cmd("rsync -e ssh -avz --bwlimit=5000 --exclude='*.log' --exclude='*.php' root@172.16.0.122:/root/votian_admin/ /root/votian_admin/");
|
||||
|
||||
function exec_cmd($cmd){
|
||||
|
||||
$cmd .= " >> /root/votian_admin/do_rsync.log 2>&1";
|
||||
writeLog("\"$cmd\"");
|
||||
exec($cmd);
|
||||
}
|
||||
|
||||
function writeLog($log_text)
|
||||
{
|
||||
$fileHandle = @fopen("/root/votian_admin/do_rsync.log", 'a');
|
||||
@fwrite($fileHandle, "[" . date("Y-m-d H:i:s") . "] " . $log_text . "\n");
|
||||
@fclose($fileHandle);
|
||||
return;
|
||||
}
|
||||
|
||||
?>
|
||||
76
html/sysadmin/cron/do_rsync_99
Normal file
76
html/sysadmin/cron/do_rsync_99
Normal file
@@ -0,0 +1,76 @@
|
||||
#!/bin/sh
|
||||
log_file="/root/votian_admin/do_rsync_`date +%Y``date +%m`.log"
|
||||
|
||||
# rsync LN (started on 26.02.2021)
|
||||
rsync -e ssh -avz root@172.16.0.147:/srv/htdocs/services/LN_LIVE/*.php /home/mps2/stadtbote/service/LN_374893028394/ >> ${log_file} 2>&1
|
||||
rsync -e ssh -avz /home/mps2/stadtbote/service/LN_374893028394/*.txt root@172.16.0.147:/srv/htdocs/services/LN_LIVE/ >> ${log_file} 2>&1
|
||||
|
||||
## rsync photos (stopped on 05.04.2016)
|
||||
#rsync -e ssh -avz --exclude=htg_pics --delete --bwlimit=5000 root@172.16.0.104:/home/retrans/ftp/mbl_foto/ /srv/www/htm/documents/photos/ >> ${log_file} 2>&1
|
||||
#echo [`date +%F" "%X" "%Z`] rsync finished >> ${log_file}
|
||||
|
||||
## restart check_jb_permanent.1000.php if not running
|
||||
# not needed any longer: disabled on 2017-12-31
|
||||
#check_jb_permanent_found="false"
|
||||
#for php_pid in `pidof php`
|
||||
#do
|
||||
# check_jb_permanent_pid=`ps $php_pid | grep check_jb_permanent.1000.php`
|
||||
# if [ "$check_jb_permanent_pid" != "" ]; then
|
||||
# check_jb_permanent_found="true"
|
||||
# fi
|
||||
#done
|
||||
#if [ "$check_jb_permanent_found" != "true" ]; then
|
||||
# cd /srv/www/htm/jobs
|
||||
# php /srv/www/htm/jobs/check_jb_permanent.1000.php >> ../log/check_jb_permanent.1000.err 2>&1 &
|
||||
# echo [`date +%F" "%X" "%Z`] check_jb_permanent.1000.php restarted >> ${log_file}
|
||||
#fi
|
||||
|
||||
# restart check_jb_permanent.auto.php if not running
|
||||
check_jb_permanent_found="false"
|
||||
for php_pid in `pidof php`
|
||||
do
|
||||
check_jb_permanent_pid=`ps $php_pid | grep check_jb_permanent.auto.php`
|
||||
if [ "$check_jb_permanent_pid" != "" ]; then
|
||||
check_jb_permanent_found="true"
|
||||
fi
|
||||
done
|
||||
#if [ "$check_jb_permanent_found" != "true" ]; then
|
||||
# cd /home/mps2/stadtbote_auto/jobs
|
||||
# php /home/mps2/stadtbote_auto/jobs/check_jb_permanent.auto.php >> ../log/check_jb_permanent.auto.err 2>&1 &
|
||||
# echo [`date +%F" "%X" "%Z`] check_jb_permanent.auto.php restarted >> ${log_file}
|
||||
#fi
|
||||
if [ "$check_jb_permanent_found" != "true" ]; then
|
||||
cd /home/mps2/stadtbote/jobs
|
||||
php /home/mps2/stadtbote/jobs/check_jb_permanent.auto.php >> ../log/check_jb_permanent.auto.err 2>&1 &
|
||||
echo [`date +%F" "%X" "%Z`] check_jb_permanent.auto.php restarted >> ${log_file}
|
||||
fi
|
||||
|
||||
## restart check_jb_permanent.auto_test.php if not running
|
||||
#check_jb_permanent_found="false"
|
||||
#for php_pid in `pidof php`
|
||||
#do
|
||||
# check_jb_permanent_pid=`ps $php_pid | grep check_jb_permanent.auto_test.php`
|
||||
# if [ "$check_jb_permanent_pid" != "" ]; then
|
||||
# check_jb_permanent_found="true"
|
||||
# fi
|
||||
#done
|
||||
#if [ "$check_jb_permanent_found" != "true" ]; then
|
||||
# cd /home/mps2/test_sb/jobs
|
||||
# php /home/mps2/test_sb/jobs/check_jb_permanent.auto_test.php >> ../log/check_jb_permanent.auto_test.err 2>&1 &
|
||||
# echo [`date +%F" "%X" "%Z`] check_jb_permanent.auto_test.php restarted >> ${log_file}
|
||||
#fi
|
||||
|
||||
## restart automailer_cfm_main.php if not running
|
||||
#check_jb_permanent_found="false"
|
||||
#for php_pid in `pidof php`
|
||||
#do
|
||||
# check_jb_permanent_pid=`ps $php_pid | grep automailer_cfm_main.php`
|
||||
# if [ "$check_jb_permanent_pid" != "" ]; then
|
||||
# check_jb_permanent_found="true"
|
||||
# fi
|
||||
#done
|
||||
#if [ "$check_jb_permanent_found" != "true" ]; then
|
||||
# cd /home/mps2/test_cfm/include
|
||||
# php /home/mps2/test_cfm/include/automailer_cfm_main.php >> ../log/automailer_cfm_main.err 2>&1 &
|
||||
# echo [`date +%F" "%X" "%Z`] automailer_cfm_main.php restarted >> ${log_file}
|
||||
#fi
|
||||
112
html/sysadmin/cron/mysql_status.php
Normal file
112
html/sysadmin/cron/mysql_status.php
Normal file
@@ -0,0 +1,112 @@
|
||||
<?php
|
||||
|
||||
date_default_timezone_set('Europe/Berlin');
|
||||
|
||||
$status_vars = array(
|
||||
"Bytes_received", // The number of bytes received from all clients.
|
||||
"Bytes_sent", // The number of bytes sent to all clients.
|
||||
"Com_select", // The number of select Statements except "Qcache_hits".
|
||||
"Qcache_hits", // The number of query cache hits.
|
||||
"Questions", // The number of statements executed by the server.
|
||||
"Slow_queries", // The number of queries that have taken more than long_query_time seconds.
|
||||
"Threads_connected", // The number of currently open connections.
|
||||
"Uptime" // The number of seconds that the server has been up.
|
||||
);
|
||||
|
||||
|
||||
//3391 SB, 3511 HT, 3611 Möbler, 3651 HTM, 3711 intern
|
||||
foreach (array("3391") as $port) {
|
||||
|
||||
$log_name = "/root/votian_admin/mysql_status_" . $port . "_" . date("Y-m") . ".csv";
|
||||
$prev_vars = array();
|
||||
$prev_output = tail($log_name, 1);
|
||||
$prev_vars = explode(";", str_replace(",", "", $prev_output));
|
||||
//print_r($prev_vars);
|
||||
if (count($prev_vars) < 21)
|
||||
writeLog("Date;Uptime;Queries;Select_no_hit;qps;qps_now;Slow;Slow_qps;Slow_now;Threads;Cache_hits;Hits_s;Hits_now;Ratio;Ratio_now;Bytes_in;Bytes_out;KBps_in;KBps_out;KBps_in_now;KBps_out_now");
|
||||
|
||||
mysql_connect("127.0.0.1:$port", "root", "%Fidewz37%") or die (mysql_error());
|
||||
//mysql_select_db("phoenix") or die (mysql_error());
|
||||
//mysql_query('SET NAMES latin1') or die ('SET NAMES latin1');
|
||||
$sql_query = "SHOW /*!50002 GLOBAL */ STATUS";
|
||||
$res = mysql_query($sql_query) or die($sql_query . ": " . mysql_error());
|
||||
$log_text = date("Y-m-d H:i:s") . ";";
|
||||
while ($row = mysql_fetch_assoc($res)) {
|
||||
if (in_array($row['Variable_name'], $status_vars)) {
|
||||
$vars[$row['Variable_name']] = $row['Value'];
|
||||
}
|
||||
}
|
||||
mysql_free_result($res);
|
||||
|
||||
$uptime_now = $vars['Uptime'] - $prev_vars[1];
|
||||
$queries_now = $vars['Questions'] - $prev_vars[2];
|
||||
$select_now = $vars['Com_select'] - $prev_vars[3];
|
||||
$slow_now = $vars['Slow_queries'] - $prev_vars[6];
|
||||
$hits_now = $vars['Qcache_hits'] - $prev_vars[10];
|
||||
$bytes_in_now = $vars['Bytes_received'] - $prev_vars[15];
|
||||
$bytes_out_now = $vars['Bytes_sent'] - $prev_vars[16];
|
||||
|
||||
$log_text .= number_format($vars['Uptime'], 0, '.', ',') . ";";
|
||||
$log_text .= number_format($vars['Questions'], 0, '.', ',') . ";";
|
||||
$log_text .= number_format($vars['Com_select'], 0, '.', ',') . ";";
|
||||
$log_text .= number_format(round($vars['Questions'] / $vars['Uptime']), 0, '.', ',') . ";";
|
||||
$log_text .= number_format(round($queries_now / $uptime_now), 0, '.', ',') . ";";
|
||||
$log_text .= number_format($vars['Slow_queries'], 0, '.', ',') . ";";
|
||||
$log_text .= sprintf("%01.1f", round($vars['Slow_queries'] / $vars['Uptime'], 1)) . ";";
|
||||
$log_text .= number_format($slow_now, 0, '.', ',') . ";";
|
||||
$log_text .= number_format($vars['Threads_connected'], 0, '.', ',') . ";";
|
||||
$log_text .= number_format($vars['Qcache_hits'], 0, '.', ',') . ";";
|
||||
$log_text .= sprintf("%01.1f", round($vars['Qcache_hits'] / $vars['Uptime'], 1)) . ";";
|
||||
$log_text .= sprintf("%01.1f", round($hits_now / $uptime_now, 1)) . ";";
|
||||
$log_text .= sprintf("%01.1f", round($vars['Qcache_hits'] / ($vars['Qcache_hits'] + $vars['Com_select']) * 100, 1)) . ";";
|
||||
$log_text .= sprintf("%01.1f", round($hits_now / ($hits_now + $select_now) * 100, 1)) . ";";
|
||||
$log_text .= number_format($vars['Bytes_received'], 0, '.', ',') . ";";
|
||||
$log_text .= number_format($vars['Bytes_sent'], 0, '.', ',') . ";";
|
||||
$log_text .= sprintf("%01.1f", round($vars['Bytes_received'] / $vars['Uptime'] / 1024, 1)) . ";";
|
||||
$log_text .= sprintf("%01.1f", round($vars['Bytes_sent'] / $vars['Uptime'] / 1024, 1)) . ";";
|
||||
$log_text .= sprintf("%01.1f", round($bytes_in_now / $uptime_now / 1024, 1)) . ";";
|
||||
$log_text .= sprintf("%01.1f", round($bytes_out_now / $uptime_now / 1024, 1)) . "";
|
||||
writeLog($log_text);
|
||||
}
|
||||
|
||||
// http://www.codediesel.com/php/tail-functionality-in-php/
|
||||
function tail($filename, $lines = 10)
|
||||
{
|
||||
$data = '';
|
||||
$fp = @fopen($filename, "r");
|
||||
$block = 4096;
|
||||
$max = @filesize($filename);
|
||||
|
||||
for($len = 0; $len < $max; $len += $block)
|
||||
{
|
||||
$seekSize = ($max - $len > $block) ? $block : $max - $len;
|
||||
fseek($fp, ($len + $seekSize) * -1, SEEK_END);
|
||||
$data = fread($fp, $seekSize) . $data;
|
||||
|
||||
if(substr_count($data, "\n") >= $lines + 1)
|
||||
{
|
||||
/* Make sure that the last line ends with a '\n' */
|
||||
if(substr($data, strlen($data)-1, 1) !== "\n") {
|
||||
$data .= "\n";
|
||||
}
|
||||
|
||||
preg_match("!(.*?\n){". $lines ."}$!", $data, $match);
|
||||
fclose($fp);
|
||||
return $match[0];
|
||||
}
|
||||
}
|
||||
@fclose($fp);
|
||||
return $data;
|
||||
}
|
||||
|
||||
function writeLog($log_text)
|
||||
{
|
||||
global $log_name;
|
||||
|
||||
$fileHandle = @fopen($log_name, 'a');
|
||||
@fwrite($fileHandle, $log_text . "\n");
|
||||
@fclose($fileHandle);
|
||||
return;
|
||||
}
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user