function visited_sites_by_cron()
{
    $unix = new unix();
    $pidfile = "/etc/artica-postfix/pids/squid.visited_sites_by_cron.pid";
    $TimeFile = "/etc/artica-postfix/settings/Daemons/exec.squid.visited.sites.php.time";
    $pid = @file_get_contents($pidfile);
    if ($pid < 100) {
        $pid = null;
    }
    $t = time();
    if ($unix->process_exists($pid, basename(__FILE__))) {
        $time = $unix->PROCCESS_TIME_MIN($pid);
        if ($GLOBALS["VERBOSE"]) {
            echo "Already executed pid {$pid} since {$time}mn\n";
        }
        die;
    }
    $mypid = getmypid();
    @file_put_contents($pidfile, $mypid);
    $TimeExec = $unix->file_time_min($TimeFile);
    if ($TimeExec < 240) {
        return;
    }
    visited_sites(true, true);
}
Esempio n. 2
0
}
if ($argv[1] == '--tables') {
    $q = new mysql();
    $q->CheckTablesSquid();
    die;
}
if ($argv[1] == '--members-month-kill') {
    members_month_delete();
    exit;
}
if ($argv[1] == '--fix-tables') {
    $GLOBALS["Q"]->FixTables();
    exit;
}
if ($argv[1] == '--visited-sites') {
    visited_sites();
    exit;
}
if ($argv[1] == '--sync-categories') {
    sync_categories();
    exit;
}
if ($argv[1] == '--re-categorize') {
    re_categorize();
    exit;
}
if ($argv[1] == '--re-re-categorize') {
    __re_categorize_subtables();
    exit;
}
if ($argv[1] == '--export-last-websites') {