Hey everyone ! We are monitoring the disk space oc...
# best-practices
r
Hey everyone ! We are monitoring the disk space occupied by our PostgresSql database, and it’s increasing due to Prefect flows runs (which is expected and totally normal) but we are wondering if there is a “clean” way to scrape data ? For example get rid off everything older than 2 months old. I guess we can always design an SQL script to do it on every prefect tables but we want to know if there is a preferred / prefect way to achieve this ?
m
@Robin Niel The link below is how we have handled certain use cases in the past. The code in the link is a slight different use case but you could tweak the code to do what you need it to I am sure. You would look at the api docs for the flow runs filter. https://discourse.prefect.io/t/how-to-bulk-delete-flow-runs-in-a-certain-state-with-the-api/2247/2