-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcron.php
More file actions
39 lines (33 loc) · 748 Bytes
/
cron.php
File metadata and controls
39 lines (33 loc) · 748 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<?php
/**
*
* Cronjobs to be executed
*
* Manual trugger:
* php cron.php <tenant_id> <script>
* ex: php cron.php 2 update_certificates
*
* Scripts:
* - expired_certificates
* - update_certificates
* - axfr_transfer
* - remove_orphaned
*
*/
# autoload classes
require ("functions/autoload.php");
# script can only be run from cli
if(php_sapi_name()!="cli") {
$Cron->errors[] = "This script can only be run from cli!";
$Cron->result_die ();
}
# fetch all cronjobs
$Cron->fetch_cronjobs ();
# set date
$date = date("Y-m-d H:i:s");
//$date = ("2026-02-11 10:10:00");
# check agent status
$Agent = new Agent ();
$Agent->test_agents ($Database, "google.com", 443, $date);
# exceute them
$Cron->execute_cronjobs ($date, $argv);