An important lesson in saving…

…and backing up your saves in case you accidentally delete the copy you are working with.

Let this be a lesson to me. I was working tonight on the lottery simulation. I wrote some more code introducing new plotted data. All was well.

I thought maybe I’d take a break. I loaded up “20.000 Light Years in Space” and played a couple rounds of the beginner level.

I figured I’d had enough fun, it was now time to package up my hard work and post to the science page. I thought to myself, there’s no sense in tarring up all the results files, there’s a couple hundred of those and they are taking up way too much space!

Lesson: The ‘rm’ command is unforgiving.

I “permanently” deleted some of the new code I had written.

I know I could dip into the computer forensics field and recover my lost file, but it’s only 30 minutes of code I lost. 30 minutes is still an inconvenience. So be warned! Make sure you are rm`ing what you mean to rm.

I’m re-writing it now and it should be posted soon. I’ll update this post when it is.

[Edit]

I’ve fixed my mistake, the new code is better than it was before I erased it all. And now there are 979 new and updated files in the Lotto section. Perl really makes it easy to generate stuff. 979 files by hand? I wouldn’t bother.

2 Responses to “An important lesson in saving…”

  1. Anonymous says:

    In csh or tcsh…

    mkdir ~/.00trash
    alias rm ‘mv \!* ~/.00trash’
    alias rmm ‘/bin/rm’
    alias unrm ‘mv ~/.00trash/\!* ./’
    alias trash ‘la ~/.00trash’
    alias mttrash ‘rmm -rf ~/.00trash/.[^,^.]* ~/.00trash/* ~/.00trash/…*’

  2. admin says:

    Not a bad idea, aliasing rm as a simple file move and assigning aliases for unremoving and emptying trash.

    You’d think that would be a default setting with *nix and that a permanent rm setting would be configured by advanced users.

Leave a Reply

 

Staypressed theme by Themocracy