My Python script deleted my own backups and I laughed for 5 minutes
Last Saturday I finally set up an automatic backup job for all my coding projects. I wrote a Python script to copy files to an external drive, tested it on a dummy folder, and it worked perfectly. Then I got clever and added a cleanup step to remove old backups so the drive wouldnt fill up. The script ran at 2am and somehow the variable pointing to the old backup folder got reassigned to my actual project directory. Woke up to find every single folder Ive written in the past year gone, including the backup script itself. I sat there staring at a blank terminal for a good while before I could even process it. No git push, no cloud sync, nothing. I did recover maybe 40% from files I had emailed myself or left on old laptops, but the rest is just a memory. Has anyone else nuked their own stuff with a well meaning automation and did you ever trust yourself with root access again?