We want to validate the backups that have been taken.
This requires adding some logic to the scripts in https://github.com/wmde/wbaas-backup.
We can check file existence before taring and encrypting. We can also check replica state with additional sql commands
The backup should be no older than 60s compared to the state of the data in the primary database.
- Check apidb file exists
- Check seconds behind master in SHOW REPLICA STATUS; and be sure it is less than 60 (can be done either before or after the back up is taken)
- Fail with a status code >0 and log an error to the console if either of the above is true
n.b. currently we cat the .metadata file which is a rough check: https://github.com/wmde/wbaas-backup/blob/main/src/backup.sh#L17