Exemplo n.º 1
0
    WriteMyLogs("This server is not in charge of statistics", "MAIN", __FILE__, __LINE__);
    if ($GLOBALS["VERBOSE"]) {
        echo "this server is not in charge of statistics (categories repositories or Statistics Appliance) ...\n";
    }
    events("this server is not in charge of statistics (categories repositories or Statistics Appliance) ...");
    die;
}
if ($GLOBALS["VERBOSE"]) {
    echo "LAUNCH: '{$argv[1]}'\n";
}
if ($argv[1] == '--nocat-sync') {
    not_categorized_day_resync();
    exit;
}
if ($argv[1] == '--repair-hours') {
    repair_hours(true);
    if ($GLOBALS["VERBOSE"]) {
        echo "END: '{$argv[1]}'\n";
    }
    exit;
}
# Recherche les tables squidhour_* et les réinjectes.
if ($argv[1] == '--defrag') {
    defragment_category_tables();
    exit;
}
if ($argv[1] == '--defragtable') {
    defragment_category_table($argv[2]);
    exit;
}
if ($argv[1] == '--rangetables') {
Exemplo n.º 2
0
    clean_empty_tables();
    exit;
}
if ($argv[1] == "--macscan") {
    macscan();
    exit;
}
$q = new mysql_squid_builder();
if (!$q->ifStatisticsMustBeExecuted()) {
    if ($GLOBALS["VERBOSE"]) {
        echo "This is not intended to build statistics - ifStatisticsMustBeExecuted -\n";
    }
    die;
}
if ($argv[1] == "--repair") {
    repair_hours();
    exit;
}
if ($argv[1] == "--restore") {
    restore_from_backup_statistics();
    exit;
}
tables_hours();
function ToSyslog($text)
{
    if (!function_exists("syslog")) {
        return;
    }
    $file = basename(__FILE__);
    $LOG_SEV = LOG_INFO;
    openlog($file, LOG_PID, LOG_SYSLOG);