Don’t rsync /var with –delete

About 10 minutes ago, I learned an important lesson: make sure you fully qualify the folder you want to sync. And don’t use the delete option if you’re not entirely sure how to use it. The bad news is that I accidentally deleted this website and panicked for a second.

But I like to look at it on the bright side. For about 10 minutes of downtime, the good news is:

  • There’s a reason why people don’t just use root all the time. I need to be better about this, because it paid off majorly this time to not have permissions
  • my laziness in working on my website template means that I didn’t accidentally erase a bunch of work
  • I now know how rsync works a bit better
  • It caused me to backup my blog database so that the next time there’s a disaster, I’ll only be partially screwed
  • I didn’t need to upgrade wordpress because a fresh install does that, too

Wow. That could’ve been a lot worse.

2 thoughts on “Don’t rsync /var with –delete”

  1. Oh man, let me tell you about what I did monday.

    So rm -rf is the only way to get rid of files right? I was cleaning up my working directory right before a commit, and did rm -rf /some/path/ * , thinking that I had skipped the space there. In fact, I did not, and rm’ed all my changes for the past week. Whoo!

    At least our internships are teaching us to be a bit more conservative with shell commands 🙂

  2. Detail … What are you rsync for? Is it feasible for mortals (rather than nerds)?

    I’m spoiled in office technologies by a long history with Lotus Notes/Domino replication. I only recently retired the Lotus Notes server in my basement. Replication made archiving really easy.

Leave a Reply

Your email address will not be published.