I think you need something like restic with a retention policy
https://restic.readthedocs.io/en/stable/060_forget.html#removing-snapshots-according-to-a-policy
--keep-{hourly,daily,weekly,monthly,yearly}
other solutions that implement similar policies are kopia and rustic
the advantage of using an off the shelf solution is that it's almost certainly more reliable than what anyone can come up with in a few hours, and, it works with incremental backups, so your space requirements are drastically reduced depending how often you run it.

yeah, I'm not sure I'd have believed this if my ex weren't the same. Seeing me concentrated would turn her on and I've never understood it. I guess we can't rationalize a fetish. She knew how to code too, though.