feat: add auto-import toggle to restore latest backup after rclone pull
Adds autoImportEnabled/autoImportHour to rclone config. A separate hourly cron finds the latest .zip in backups/ and restores it to the database (drop schema, psql restore, apply migrations). Frontend shows toggle + time picker + Import Now button in the Receiver PC section. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -19,6 +19,13 @@ export interface RcloneConfig {
|
||||
lastSyncAt: string | null;
|
||||
lastSyncStatus: string | null;
|
||||
lastSyncError: string | null;
|
||||
|
||||
// Auto-import: restore latest backup after rclone pull
|
||||
autoImportEnabled: boolean;
|
||||
autoImportHour: number;
|
||||
lastImportAt: string | null;
|
||||
lastImportStatus: string | null;
|
||||
lastImportError: string | null;
|
||||
}
|
||||
|
||||
const DEFAULT_CONFIG: RcloneConfig = {
|
||||
@@ -31,6 +38,11 @@ const DEFAULT_CONFIG: RcloneConfig = {
|
||||
lastSyncAt: null,
|
||||
lastSyncStatus: null,
|
||||
lastSyncError: null,
|
||||
autoImportEnabled: false,
|
||||
autoImportHour: 22,
|
||||
lastImportAt: null,
|
||||
lastImportStatus: null,
|
||||
lastImportError: null,
|
||||
};
|
||||
|
||||
export function readRcloneConfig(): RcloneConfig {
|
||||
|
||||
Reference in New Issue
Block a user