summaryrefslogtreecommitdiff
path: root/includes/refresh.php
diff options
context:
space:
mode:
Diffstat (limited to 'includes/refresh.php')
-rw-r--r--includes/refresh.php5
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");