Talkitup has been closed since August 2009. I leave this archived version up for some of the juicy goodness contained herein. Computers suck - go outside and play. Full Version link keeps you in the archive. Contact

TalkitUp - A Debian Support Forum Command Line Goodness
Pages: 1
Decided to post it here .... By: useResa Date: April 17, 2008, 01:35:25 PM
... although not sure whether it is "Command Line Goodness".

Well it was bound to happen someday and yesterday it did.
I had a long day at work, came home, helped the kids with homework, visited some forums, posted here and there and (too) late in the evening decided to make quickly a "backup" of my laptop.
First let me explain, it is not actually a backup ... I have a copy of my /home and my Virtual Machines directory on an external hard drive.

So I hooked up my external hard disc and as always wanted to throw away what I had on the external disc.
So cd-ed into the directory and ... then it went sour
Instead of giving the command I normally give
Code:
rm -Rf home/

I gave the command
Code:
rm -Rf /home

A minor difference but ... with quite some impact. Fortunately I noticed quite quickly that the light on my external hard disc was not flickering so stopped the command with <Ctrl>-C. But damage was already done.

So I have work to do ... now I have to figure out what is lost (well at least all my settings, my mail accounts for Evolution) and figure out what I can restore. Maybe it is time for a more decent back up procedure.

Why I decided to post my stupidness ... just to warn you all out there.
Moral of the story: It does make a difference where you put the /


Re: Decided to post it here .... By: useResa Date: April 17, 2008, 02:18:43 PM
So have been looking around and searching how I could try and get back as much as I have from my "backup" without destroying any files that I have created ever since the "backup" was made.

AFAIK and what I can determine on basis of the documentation the following should do the trick (including any hidden files).
First I cd into the /home directory on the external disc
Second I give the command
Code:
cp -aur my-username /home
According to me now all files and directories (including hidden ones) should be copied from my "backup" to my regular /home directory IF and ONLY IF the file that is to be copied from the backup is non-existent or older in the /home directory.

Can someone confirm this BEFORE I screw up more.
Re: Decided to post it here .... By: machiner Date: April 17, 2008, 04:04:29 PM
The -u flag is to update, so you look good.


When you're sorted, add this to your ~/.bashrc file:

alias rm='rm -i'
Re: Decided to post it here .... By: useResa Date: April 17, 2008, 04:29:50 PM
I know about the -i option, but I hate that I have to agree to everything I want to delete.
Normally I delete things I really want to delete  Wink
Re: Decided to post it here .... By: xplozion Date: April 17, 2008, 05:40:02 PM
Quote from: machiner on April 17, 2008, 04:04:29 PM
The -u flag is to update, so you look good.


When you're sorted, add this to your ~/.bashrc file:

alias rm='rm -i'

This is why i always have a ~/.bashrc copy with ALL the custom alias i have added since 1 year ago hahaha. Every debian install gets it!...

Well sh*ts happens right? Who have not done "rm -R /"  Roll Eyes

SMF Archive Funded by SMF For Free Free Forum Hosting (smfforfree.com)
SMF Hacks(smfhacks.com)