Backup.bak.bak.bak...
- 2 minutes read - 337 wordsSo, another war story. This one didn’t happen to me as such, but comes from someone I worked with at a previous employer. A customer had called in to the support desk because their database backups weren’t working. As the 1st line couldn’t fix it, it went to the Consultancy team, who I worked alongside as Internal IT. He’d already diagnosed the problem, and fixed it, but the actual fault was too good not to share, so he shared with me, and now I’m sharing with you:
The general idea was that they did a database dump to a disk file, and then that file got picked up by the nightly tape backup. The process had run fine for ages, but had suddenly starting failing, and they were concerned that they didn’t have a valid backup. (Spoiler — they didn’t).
But what on earth could the actual fault be? There was plenty of disk space, the tape backup was running fine and backing up the volume fine, but the ‘database dump’ script kept reporting a failure.
OK, the title of this post is a giveaway, but here goes: the script basically
did a database dump into a file called "backup.bak". Clearly they wanted to
keep a few days worth, just in case there was a data issue that meant last
night’s backup wasn’t good. So the script first added ".bak" to the end of all
of the existing files, and then wrote a new "backup.bak".
And, sixty-something days in, the process began failing, because we now had a filename like
"backup.bak.bak.bak.bak.bak.bak.bak.bak.bak.bak.bak.bak.bak.bak.bak.bak.bak.bak.bak.bak.bak.bak.bak.bak.bak.bak.bak.bak.bak.bak.bak.bak.bak.bak.bak.bak.bak.bak.bak.bak.bak.bak.bak.bak.bak.bak.bak.bak.bak.bak.bak.bak.bak.bak.bak.bak.bak.bak.bak.bak.bak.bak"and that filename couldn’t be extended because the resulting name would be too long to go on the disk. So the process died.
The fix was, of course, to keep only the last couple of weeks of backups, so that we never went over the maximum file length. Another one for the weird limits files, I guess.
Hey, if this made you smirk, feel free to leave a comment. I read them all, I promise!