Idleness in deleting files :(

Ye' old general discussion board. Basically, for everything that isn't covered elsewhere. Come here to shoot the breeze, shoot your mouth off, or whatever suits your fancy.
This forum is not for asking programming related questions.

Moderator: General Moderators

Post Reply
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Idleness in deleting files :(

Post 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 :(
Charles256
DevNet Resident
Posts: 1375
Joined: Fri Sep 16, 2005 9:06 pm

Post 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..
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

This is why I version control all projects I work on, personal or not.
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post 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.
Charles256
DevNet Resident
Posts: 1375
Joined: Fri Sep 16, 2005 9:06 pm

Post 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.
User avatar
Maugrim_The_Reaper
DevNet Master
Posts: 2704
Joined: Tue Nov 02, 2004 5:43 am
Location: Ireland

Post 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).
timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Post 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...
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post 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.
User avatar
Benjamin
Site Administrator
Posts: 6935
Joined: Sun May 19, 2002 10:24 pm

Post 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.
User avatar
Nathaniel
Forum Contributor
Posts: 396
Joined: Wed Aug 31, 2005 5:58 pm
Location: Arkansas, USA

Post by Nathaniel »

Heh, I'm currently cleaning up source code in a project... is this thread a warning, or an omen? :)
Charles256
DevNet Resident
Posts: 1375
Joined: Fri Sep 16, 2005 9:06 pm

Post 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. :-D
User avatar
Maugrim_The_Reaper
DevNet Master
Posts: 2704
Joined: Tue Nov 02, 2004 5:43 am
Location: Ireland

Post 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.
Post Reply