My site has been up and running for a few months, and I’ve generated about 6 weeks of daily backups. Each backup is about 100MB so it’s starting to add up. It was time I wrote a script to prune the backups.
Well sort of. As the was a very well defined problem (keep some backups based on a set of rules) and the domain was very well defined (files in a folder), I took the opportunity to get an AI to write the code for me. I normally use Perplexity, but I decided to let Claude.ai have a go.
I was impressed. It wrote the code in a manner that was clear and easy to read, and I could get a grip on it pretty quickly. I even got it to generate test files so I could run the code against a years worth of ‘backups’. All in all I spent about an hour from start to finish including writing up the experience for this site. The writeup took the longest part!