diff options
author | Minteck <contact@minteck.org> | 2023-02-08 22:42:21 +0100 |
---|---|---|
committer | Minteck <contact@minteck.org> | 2023-02-08 22:42:21 +0100 |
commit | 885a05be06d0b42835652208c729e5fded451c26 (patch) | |
tree | e848835a00bce1bf790b867535a2c1e83cbcbe2e /includes/refresh.php | |
parent | 5026c2f48d2a1bf8fbd3a63c1e41e59431054878 (diff) | |
download | pluralconnect-885a05be06d0b42835652208c729e5fded451c26.tar.gz pluralconnect-885a05be06d0b42835652208c729e5fded451c26.tar.bz2 pluralconnect-885a05be06d0b42835652208c729e5fded451c26.zip |
Updated 9 files, added 2 files and deleted pages/bitset.inc (automated)
Diffstat (limited to 'includes/refresh.php')
-rw-r--r-- | includes/refresh.php | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/includes/refresh.php b/includes/refresh.php index bbf8b01..ecf724a 100644 --- a/includes/refresh.php +++ b/includes/refresh.php @@ -243,8 +243,11 @@ foreach (json_decode(file_get_contents("./data/ynmuc/members.json"), true) as $m echo("Backing up...\n"); -if (date('i') === "00" || date('i') === "01" || date('i') === "02" || date('i') === "03" || date('i') === "04") { +$lastBackup = (int)trim(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/backup.txt")); + +if (time() - $lastBackup >= 3600) { require_once "./backup.inc"; + file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/backup.txt", time()); echo("Backup completed\n"); } else { echo("Backup skipped\n"); |