clean-and-green-philly icon indicating copy to clipboard operation
clean-and-green-philly copied to clipboard

Prune old tile file backups and detailed diff reports from GCP bucket

Open zigouras opened this issue 1 year ago • 1 comments

Describe the task

The backup and diff functionality ends with a pruning of old backed up schemas older than a configured number of days, currently 365. This is to save space in the database. Similarly, we can delete the timestamped backed up tile files and detailed diff reports from the Google Cloud bucket.

Currently, the tiles files backups are generated after every run of the back-end script, regardless of whether a reload is forced or not, and never deleted. The detailed diff reports are generated if there are any differences found during a run of the back-end script with forced reloading, and never deleted.

The tiles file backups are in the format backups/name_%Y_%m_%dt%H_%M_%S.ext, e.g. backup/vacant_properties_tiles_2024_06_02t17_17_08.pmtiles or backup/vacant_properties_tiles_staging_2024_06_02t16_34_41.pmtiles

The detailed diff reports are in the format diff/%Y_%m_%dt%H_%M_%S/table_name.html, e.g. diff/2024_05_10t14_50_53/vacant_properties.html.

Using the same cutoff as used to prune the old postgres schema backups define in config.py::max_backup_schema_days, delete the old tiles file backups and detailed diff report folders after a force reload run of the back-end script.

Acceptance Criteria

Coding of the above requirement plus unit tests to assert functionality.

Additional context

The existing Python function backup_archive_database.py::BackupArchiveDatabase::prune_old_archives. Issues #520, #662.

zigouras avatar Jun 24 '24 03:06 zigouras

This issue has been marked as stale because it has been open for 30 days with no activity.

github-actions[bot] avatar Oct 01 '24 16:10 github-actions[bot]

Not a priority right now--will tackle after the pipeline + database rewrite.

nlebovits avatar Nov 20 '24 01:11 nlebovits