38682-vm/api/auto_backup.php
2026-03-15 02:34:33 +00:00

18 lines
654 B
PHP

<?php
require_once __DIR__ . '/../db/config.php';
require_once __DIR__ . '/../includes/functions.php';
// This script triggers the auto backup check.
// It should be called asynchronously from the frontend to avoid blocking page load.
// We don't necessarily need to be logged in to trigger the check,
// as the function itself checks if 24h passed.
// But for security, let's at least check if it's a local or authorized request if possible.
// For now, trigger_auto_backup() is safe because it only runs once every 24h.
session_write_close();
trigger_auto_backup();
header('Content-Type: application/json');
echo json_encode(['success' => true]);