LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-11-2009, 06:00 PM   #1
cverwey
LQ Newbie
 
Registered: Jul 2009
Location: Kingston, Jamaica
Posts: 3

Rep: Reputation: 0
Unhappy How to recover removed Files


Hi all

I am desperate here. I am new to the Linux OS and ran a command to tar a few files into 1 tar file and remove the originals after. However only some were added to the tar file and the rest removed. I really need some assistance in trying to recover the removed files.. The command I ran was.....# find . -name <filename_200907*> | xargs tar cvf filename.tar --remove-files

Thanks a million

Last edited by pixellany; 08-11-2009 at 06:45 PM. Reason: deleted "urgent" from title
 
Old 08-11-2009, 06:44 PM   #2
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738
Welcome to LQ!!

Please do not put words like "urgent" into threads or titles. We are volunteers and we respond at our own speed. (I have edited the title)

were there any error messages from tar?

Was this the actual syntax? <filename_200907*>
If not, please post what you actually put here.

While you are planning what to do next, do not anything that would cause a write to that disk. Ideally, configure things so you are running from another system and you only mount that disk when you want to read something.

The standard tool is "testdisk"---Google will find the site.

Last edited by pixellany; 08-11-2009 at 06:45 PM.
 
Old 08-11-2009, 06:57 PM   #3
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,331
Blog Entries: 55

Rep: Reputation: 3529Reputation: 3529Reputation: 3529Reputation: 3529Reputation: 3529Reputation: 3529Reputation: 3529Reputation: 3529Reputation: 3529Reputation: 3529Reputation: 3529
To the OP: chances are very slim you will recover files and the chance diminishes as long as the drive is being read from and written to. Immediately shutting down the machine once you found out the error would have been the first thing to do. Next would be making a backup by booting a Live CD or an installer CD in rescue mode, not mount the disk and use 'dd' to make a copy of the disk to a file on a physically different disk. With a successful backup in place you have the opportunity to try several tools to examine your disks contents like testdisk and photorec. There are more tools but they tend come with a steep learning curve. I have to emphasise you shouldn't get your hopes up too high: chances are slim you will recover any files and chances you will recover complete files are even slimmer.
 
Old 08-11-2009, 07:11 PM   #4
cverwey
LQ Newbie
 
Registered: Jul 2009
Location: Kingston, Jamaica
Posts: 3

Original Poster
Rep: Reputation: 0
Thanks guys

Well this is a server used by my comp so a shutdown was out of the question. I can't understand why this command failed so as I have run it before and it has placed all files found by the wildcard into tar. At this point I am very hesitant to run photorec or testdisk so as such I will consider the data lost. The good thing is that it was already used and processed and bzipped.

To Pixelleny the original command was # find . -name <reports_200907*> | xargs tar cvf reports_200907.tar --remove-files. This was to search and tar all report files for the month of july that were successfully processed.

Thanks again for the help guys
 
Old 08-11-2009, 11:32 PM   #5
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738
So the file names actually had the < and > ? The reason I ask this is that I have found it better to always put the name string in quotes. Depending on the contents of the current directory, strange things can happen without the quotes.
 
Old 08-12-2009, 12:12 AM   #6
cverwey
LQ Newbie
 
Registered: Jul 2009
Location: Kingston, Jamaica
Posts: 3

Original Poster
Rep: Reputation: 0
Apologies I forgot to remove the <> it was # find . -name "reports_200907*" | xargs tar cvf reports_200907.tar --remove-files
 
Old 08-12-2009, 01:01 AM   #7
Wim Sturkenboom
Senior Member
 
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Slackware 10.1/10.2/12, Ubuntu 12.04, Crunchbang Statler
Posts: 3,786

Rep: Reputation: 282Reputation: 282Reputation: 282
There is one important lesson when it comes to backups that I have learned a while ago: always verify that a backup is correct. In this case it does not seem that much harm was done and I hope that the lesson was learned.

In a company I worked for, only incremental backups were made of the mailboxes on an exchange server. When the shit hit the fan, not all mailboxes could be recovered because an early incremental backup was corrupted. Nice way to clean out your inbox
The departemental head got fired for it.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
"Permission Denied" when using Ubuntu live cd to recover thunderbird files. gkhoward Linux - Newbie 5 06-04-2009 12:12 PM
delete all files that are "5 lined" ---urgent--- raghu123 Programming 16 08-14-2008 01:10 AM
Do you view uninformative thread subjects like "urgent", "please help", etc. bigrigdriver General 17 02-21-2008 02:08 AM
How to recover "Shift Delete" deleted files? gimmee Fedora 1 07-05-2007 06:07 AM
Recover files after "rm" command on ext2 & fat32 pixelV Linux - Hardware 0 07-14-2003 06:52 AM


All times are GMT -5. The time now is 03:57 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration