38682-vm/api/auto_backup.php
2026-02-25 02:50:54 +00:00

17 lines
631 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.
trigger_auto_backup();
header('Content-Type: application/json');
echo json_encode(['success' => true]);