From 885a05be06d0b42835652208c729e5fded451c26 Mon Sep 17 00:00:00 2001 From: Minteck Date: Wed, 8 Feb 2023 22:42:21 +0100 Subject: Updated 9 files, added 2 files and deleted pages/bitset.inc (automated) --- includes/refresh.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'includes/refresh.php') 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"); -- cgit