Page 1 of 1
Idleness in deleting files :(
Posted: Sun Jun 25, 2006 1:52 pm
by Chris Corbyn
Ever do that thing where you start cleaning up your source directory and after some looking at an odd looking file you go ahead and `rm <filename>'. Just as you hit the enter key it dawns on you that the file you just deleted was actually an important file you spent half a day writing and you don't have a copy
I just did it... it's not that it was hard to write but I really can't be bothered to go back and re-write it all over again... I even went so far as to considering going through the whole process of recovering/undeleting the data from ReiserFS but the risk of file system inconsitencies far outweighs the few hours I'd spend re-writing it.
Sometimes I'm just absent minded and do stupid things like this

Posted: Sun Jun 25, 2006 1:55 pm
by Charles256
try chmodding the usr file to 777...just so ya know that essentially makes your root user inaccessible....had to re-install the OS..doh..
Posted: Sun Jun 25, 2006 1:57 pm
by feyd
This is why I version control all projects I work on, personal or not.
Posted: Sun Jun 25, 2006 2:02 pm
by Chris Corbyn
Charles256 wrote:try chmodding the usr file to 777...just so ya know that essentially makes your root user inaccessible....had to re-install the OS..doh..
I deleted all of /usr/bin once while I was moving the OS from one partition to another. I deleted it, then realised I hadn't actually copied it yet. Luckily it was a fairly fresh SuSE installation and I'd just set another one up at the same sort of time so I took the directory from the other machine and just re-installed my apps.. seemed to work although it was a heck of a botch up.
Posted: Sun Jun 25, 2006 2:14 pm
by Charles256
heh.it wasn't too big a deal for me either. I had been doing linux installs all day, fedora, SuSE, Ubuntu...so it was just another botch up of the day while I figured out how to install things..finally settled on Ubuntu.
Posted: Sun Jun 25, 2006 4:53 pm
by Maugrim_The_Reaper
I'm with feyd, for the last two years any source code I write has been committed to a local CVS (more recently SVN) repository, which is regularly backed up both to a separate HDD and PC. With this setup it's dead simple to recover from idle mistakes (and I make some whoppers too at times).
Posted: Sun Jun 25, 2006 5:04 pm
by timvw
Charles256 wrote:try chmodding the usr file to 777...just so ya know that essentially makes your root user inaccessible....had to re-install the OS..doh..
Since when is chmod 777 going to keep someone from altering it???
If you really want to enforce a file to be unmodified, set the sticky bit...
Posted: Sun Jun 25, 2006 5:45 pm
by Chris Corbyn
Yeah I didn't get that niether. 777 is full access to everybody. As root you can even make a file unwritable to yourself and still write to it.
I really should start using version control in my own personal projects too... I've always just thought of version control as being more useful where multiple developers are working on the same code base. Of course, some people like to take snapshots from the repositiory before official releases too.
Posted: Sun Jun 25, 2006 6:11 pm
by Benjamin
I'm just going to set up a cron job to back up certain directories every few hours. Once or twice I have deleted something I "needed", but I had spare copies on another server so it didn't hurt too badly.
Posted: Sun Jun 25, 2006 6:22 pm
by Nathaniel
Heh, I'm currently cleaning up source code in a project... is this thread a warning, or an omen?

Posted: Sun Jun 25, 2006 11:21 pm
by Charles256
you know, i thought the same thing too but appearantly one of the files that has roots information in it has to have certian setting and if it's anything else it goes screwy.. : shrugs : don't ask me..just telling you what happened.

Posted: Mon Jun 26, 2006 2:43 am
by Maugrim_The_Reaper
I really should start using version control in my own personal projects too... I've always just thought of version control as being more useful where multiple developers are working on the same code base. Of course, some people like to take snapshots from the repositiory before official releases too.
Consider what version control allows. You can revert/export any revision of any file that has ever existed (no such thing as a lost file), you can branch out new versions for experimental/test development and then merge succesful changes into the main line, or simply discard them. ou can maintain separate versions and merge bug fixes from branch to branch. You can view the log for each individual file with your commit messages, which if you add good messages for each commit keep a detailed record of all changes.
That was all without mentioning multiple developers...

. I certainly recommend it. It may feel odd at first but it's a powerful tool for personal development.