Poo

ajt on 2003-06-17T15:46:24

I just deleted some Perl scripts I was working on. I should have them back tomorrow from tape, but I'm not happy with myself. On almost every nix system I've ever used, rm has been aliased to rm -i, but not on this one, though it is now. Even if I blame it on my hay fever and nasty headache, I feel a right plonker at the moment.....


rm -i is bad because ...

drhyde on 2003-06-17T16:09:52

... when you get used to it, this badness happens, or you get used to blindly saying yes and deleting stuff anyway because it almost never asks to delete stuff you didn't want to delete in the first place.

And anyway - what no CVS? :-)

Re:rm -i is bad because ...

ajt on 2003-06-17T19:19:27

I can see the argument in this, indeed, you could say that's why I screwed up. Thankfully it's not serious, and the files are backed up, but it was annoying....

CVS, that something that we hope to implement soon....

Re:rm -i is bad because ...

petdance on 2003-07-15T22:23:53

There's no reason you can't run your own CVS repository locally, just yourself. It doesn't have to be installed and used by everyone in order for you, personally, to take advantage of it.

Re:rm -i is bad because ...

ajt on 2003-07-18T20:35:32

I know, it was a feeble excuse, but now I'm in a team of two instead of one, a lot of things will be done better.....

backups

inkdroid on 2003-06-17T17:17:38

You are in good company. I'm down at YAPC, and heard Damian talk yesterday about how he deleted *ALL* of his slides minutes before he was to start his talk on everyday perl. He took the time to point out to everyone, that it's absolutely essential to have your talk backed up (he had a CD backup). Of course backups only work when you do them :)

Re:backups

ajt on 2003-06-17T19:27:21

When I was doing my PhD, I saw many people suffer horribly at the hands of lost files, and the University showed no mercy. As a result I was paranoid, and had back-ups on different PCs, different Unix servers, and on floppy disks all over the country. As you would expect I had no problems at all, but I've taken a reasonable attitude ever since.

Over the years I've had NT die a few times, and take the NTFS partition with it, so I've always kept data spread over multiple partitions, and I make regular backups to CD-R.

In this case it was some scripts to do a process once, that I was re-using, and instead of deleting the log files, I deleted the scripts. I'll survive - though I did feel very stupid.

Me too

runrig on 2003-06-17T19:02:24

After experiencing that myself (and having to wait hours for the backup to unload, but being glad there was a backup), I wrote an alias for rm which I haven't yet been sorry about.

Re:Me too

ajt on 2003-06-17T19:31:41

I was thinking about this on the way home, it can't be that hard to make rm do backing up on the fly. But as drhyde pointed out above, it could lull one into a false sense of security, and one could still come unstuck!

I suppose I'll just have to bite the bullet and actually use CVS properly.

Backing up != 'rm -i'

runrig on 2003-06-17T20:45:14

With 'rm -i' you get into the habit of just saying yes, but with an 'rm' that backs up, it just happens all the time. And even with CVS, I could see losing a days worth of work with 'rm *.somthing' and accidentally putting a space between the '*' and the '.'

I wasn't sure myself if I'd like my rm alias, but so far it's been fine for me.

Re:Backing up != 'rm -i'

runrig on 2003-06-17T20:47:01

And 'rm -i' is annoying when you're removing lots of files.

Re:Backing up != 'rm -i'

ajt on 2003-06-17T20:56:35

Very!

Re:Backing up != 'rm -i'

drhyde on 2003-06-18T08:39:41

Override it with -f.

Re:Backing up != 'rm -i'

koschei on 2003-06-17T23:31:24

One of the reasons I enjoy using zsh as my shell: it catches 'rm *' (and the assorted variants that are mistypes of others buthave the same effect) and asks:
zsh: sure you want to delete all the files in /home/iain/foobar [yn]?
Very nice.

Re:Backing up != 'rm -i'

drhyde on 2003-06-18T08:43:15

Does this not suffer from the same problem as aliasing with -i? I know that my muscle memory would very quickly pick up on typing rm * enter y enter.

Re:Backing up != 'rm -i'

koschei on 2003-06-18T09:17:22

If rm ever wants me to confirm something, I'm doing something wrong. Thus it never enters muscle memory to automatically press 'y'.

If you've aliased with -i, you'll be asked for confirmations on every little thing. With this, it's only major things that you probably didn't mean.

Of course, if you switch between accounts, some using zsh and some not, you'll have a problem =)

rm -rf $HOME

BooK on 2003-06-18T10:12:39

Recently, I tried to create a local CPAN config, and after typing 3 times the /home/book/.cpan/ string in the config file (which is a Perl script), I decided to be clever and type $HOME = '/home/book/.cpan/' at the beginning of that script.

The mistake was to set the values as '$HOME/foo' (note the single quotes). Friendly as ever, CPAN.pm was very happy to create a directory named $HOME in my home directory. So my next move was to type rm -rf $HOME. I mean, that's exactly what I wanted to do... not.

Thanks for the backups. Very much.

Re:rm -rf $HOME

ajt on 2003-06-18T10:29:51

Very bad.... A little bit more drastic than my cock-up. As I read somewhere recently "a flamingo-up" like a cock-up only bigger and pink.

Yes, I know "cock-up" is not a reference to the anmimal or body parts, but it sounds good when things go wrong....

Been There...

vek on 2003-06-18T19:28:03

Well at least you have a backup :-) At least you didn't remove a program that hadn't been backed up yet.

Yep I did that a couple of years ago. I'd been working on a prog for about 3-4 hours and had some test files in the same directory as the prog. I'd finished working on the code for the day and figured I should remove the test files as I didn't need them anymore. My test files were all named termYYYYMMDD so I just did a quick rm te*. The problem? My program was called termrpt.pl. So seeing as I hadn't committed the changes to CVS and the backups had yet to run for the day - I was SCREWED.

I can look back on it now with some humour but at the time I was absolutely gutted.

Re:Been There...

ajt on 2003-06-18T20:07:25

I don't have the luxury of CVS (yet), so it was a good job I'd just started, but I do have tape backup, so in my case not a dissaster, however, things will have to change, as it could have been very bad!

Re:Been There...

drhyde on 2003-06-29T11:48:19

But that's OK, you were planning to throw the first version away anyway, right? :-)