Backup: add on-exit option "Auto backup every X days"

Aperta
#1,240 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
45/100
Tipo di issue
Funzionalità
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
python
Ambito
data, desktop

Direzione di ricerca

Start with docs/architecture/backup.md and the on-exit backup flow it describes, including the existing Ask/Always/Never choice and has_changes_since_backup(). The new option needs a stored last-backup timestamp (backup.last_state holds only fingerprints), a days spin box in Settings → Advanced → Backups, and the keep_auto limit applied to its backups. Done means the on-exit check backs up only when X days have passed and something changed, failures leave the count unchanged, and the architecture doc and User Guide are updated.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Problem

The on-exit backup setting offers Ask, Always and Never. Always backs up at every exit where something changed, which can be slow with large databases. Never relies on the user remembering to back up. There is no way to ask for a backup automatically, but only every so often.

Proposal

Add a fourth choice to the on-exit setting in Settings → Advanced → Backups: Auto backup every X days.

With this option, on exit, OpenSAK backs up without asking if both of these are true:

  • at least X days have passed since the last backup
  • something has changed since the last backup (has_changes_since_backup(), as in the current on-exit flow)

Otherwise the window just closes, and the check runs again at the next exit.

Details

  • Timing: the backup runs on exit, like the other options, with no timer or background backup while working. Scheduled backups while OpenSAK is running remain out of scope, as in docs/architecture/backup.md.
  • Last backup date: this needs a new stored value, because backup.last_state only holds file fingerprints and no timestamp. Any successful backup, manual or automatic, restarts the count.
  • X days setting: a spin box, shown only when this option is selected.
  • Rotation: these are auto sets, so the existing "keep automatic backups" limit (backup.keep_auto) applies.
  • Failure: a failed backup is shown to the user and doesn't restart the count, so it is retried at the next exit.
  • Unusable backup folder: same as Always today: the prompt is shown instead.
  • Docs: update docs/architecture/backup.md and the User Guide.
  • Default for x should be 5
  • only a full backup resets the counter not a single DB backup

Part of the backup area: #942, on-exit flow #959.

Lingua principale
Python
Stelle
37
Fork
17
Merge medio
21h 5m
PR unite (30g)
131

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di OpenSAK-Org/OpenSAK

Tutte le issue di OpenSAK-Org/OpenSAK

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.