Còpies de seguretat i retenció
Les ordres de còpia de seguretat, i quant de temps es conserven les còpies, les tasques i els registres d’auditoria
Canvia aquestes variables per controlar quant d’historial conserva la base de dades i quantes còpies de seguretat es queden al disc.
Exemple
Conserva les tasques acabades durant 90 dies i el rastre d’auditoria durant dos anys. Al .env del projecte compose:
JOB_RETENTION_DAYS=90
AUDIT_RETENTION_DAYS=730
Una tasca diària elimina les tasques acabades més antigues que això a les 2:30 de la matinada i les entrades d’auditoria a les 3:30. Una tasca en execució, o una que espera aprovació, no s’elimina mai. Totes dues variables s’apliquen sense reiniciar quan es canvien a la pàgina de configuració.
Variables
Totes les variables d’aquest grup, amb el seu tipus, el seu valor predeterminat i la seva descripció:
| Variable | Opcions/Valors per defecte | Comentaris |
|---|---|---|
| OLD_BACKUP_DAYS number added in version 4.0.3 | Valor per defecte: 60 | Backup retention (days)
When backups are made, they are kept for this many days before being removed. This applies to form backups made through the designer (not database backups). 0 keeps every restore point, matching AUDIT_RETENTION_DAYS, JOB_RETENTION_DAYS and NIGHTLY_BACKUP_RETENTION. It used to mean the opposite here - everything older than a day was removed - while the status page reported it as “never”. |
| NIGHTLY_BACKUP_RETENTION number added in version 6.1.0 | Valor per defecte: 30 | Nightly backups kept
Number of automated nightly backups to retain. AnsibleForms automatically creates a full backup (database + config + forms) every night at midnight. Older nightly backups beyond this count are automatically deleted. Set to 0 to disable automatic cleanup (not recommended). Only backups that actually contain a usable database dump count towards this number, so a run of failed backups can never push a good one out. |
| AUDIT_RETENTION_DAYS number added in version 6.3.0 | Valor per defecte: 365 | Audit log retention (days)
How long entries in the audit trail are kept. The trail is append-only, so without a sweep it grows for ever; a daily task at 3:30 AM removes entries older than this. Set to 0 to keep everything. |
| JOB_RETENTION_DAYS number added in version 6.3.0 | Valor per defecte: 90 | Job history retention (days)
How long finished jobs and their output are kept. Job output can be large, so this is usually the fastest growing table in the database; the Status page reports its size. A daily task at 2:30 AM removes finished jobs older than this, together with their output. Only finished jobs are ever removed - a running job, or one awaiting approval, is kept however old it is. Defaults to 90 days since 7.6.0; before, the default 0 kept everything. Set 0 to keep every job for ever. |
| UPGRADE_BACKUP number added in version 7.0.0 | Valor per defecte: 1 | Back up the database before an upgrade
Before upgrading from an older release, the worker takes a regular backup (it shows on the Backups page, named after the release), then upgrades. If the backup fails (no |
| MYSQLDUMP_COMMAND string added in version 6.0.0 | Valor per defecte: mariadb-dump --ssl-verify-server-cert=OFF | Database dump command
MySQL dump commands and MySQL/MariaDB flavours differ, hence the need for a configurable command. |
| MYSQL_COMMAND string added in version 6.0.0 | Valor per defecte: mariadb --ssl-verify-server-cert=OFF | Database restore command
MySQL restore commands and MySQL/MariaDB flavours differ, hence the need for a configurable command. |
| BACKUP_COMMAND_TIMEOUT_SECONDS number added in version 6.3.0 | Valor per defecte: 3600 | Backup and restore timeout (seconds)
How long the database dump and the database restore may run before they are killed. Both used to inherit the generic 60 second command timeout, which no real database can honour. Raise it if a large database is cut short; a restore that is killed part way leaves the database partially replayed, because the dump drops and recreates each table in turn. |