Lesson of the day,to avoid, such mistake,were Man erases thousands of websites with a bad command,Server owner says a script containing the dreaded “rm -rf” code went awry.
As one business owner showed, things can go spectacularly wrong when you don’t backup properly. User “bleemboy,” who runs a site-hosting business with 1,535 customers (!), wrote to a server forum saying he was using a bash script command to erase some specific files. The command he used, “rm -rf” is infamous in Linux circles for causing disasters, thanks to the “f” part that forces it to proceed without warnings. Normally, his script only deletes specific files, but something went wrong and “all servers got deleted and the offsite backups too,” since they were mounted to the same machine.
Many of the replies were pretty negative, and some even doubted the user was real based on the unprofessional errors he made (did we mention he owned a hosting business?). One even said, “you’re going out of business. You don’t need technical advice, you need to call your lawyer.” However, less fatalistic folks suggested taking the disks to a recovery firm to see if the data could be saved.
Luckily, there appears to be a happy ending: “We consulted a data recovery company who analyzed one of our 1,500+ server disks for a reasonable feel, and after diagnoses, sent … a list of recoverable files. All files are here. Now we’re finding the money to pay [them] for all our servers.” Meanwhile, let’s all heed the advise of “Tim” from the same forum: “Backups need to be offsite, offline and incremental. That you could delete them from your main server means they weren’t what I would call backups.”