The FreeBSD Forums  

Go Back   The FreeBSD Forums > Base System > General

General General questions about the FreeBSD operating system. Ask here if your question does not fit elsewhere.

Reply
 
Thread Tools Display Modes
  #1  
Old October 30th, 2009, 20:01
albsallu albsallu is offline
Junior Member
 
Join Date: Jun 2009
Posts: 49
Thanks: 0
Thanked 0 Times in 0 Posts
Default Backup restore

I am fairly new to restoring a users home directory from a backup file.

I have a backupfile seating in the /usr/backups/ directory. A user mistakenly delted some of her email folders. I want to restore the users home directory without having to wait for long to extract the entire backup file. How do I go about doing that? Also, during the restore, i want to be able to restore without affecting new emails.

Note* The backup file is zipped home.backup.tgz

Thanks

Last edited by albsallu; October 30th, 2009 at 20:30.
Reply With Quote
  #2  
Old October 30th, 2009, 22:37
killasmurf86's Avatar
killasmurf86 killasmurf86 is online now
Senior Member
 
Join Date: Nov 2008
Location: Riga, Latvia
Posts: 1,458
Thanks: 145
Thanked 161 Times in 114 Posts
Default

untar it....
read restore
there's interactive mode.... with it you can do partial restore....

you can test stuff like that on your /tmp....

sorry I won't explain step by step... I'm to busy right now
__________________
vim is the best editor
Reply With Quote
  #3  
Old November 7th, 2009, 07:23
jostrowski jostrowski is offline
Junior Member
 
Join Date: Jan 2009
Posts: 9
Thanks: 2
Thanked 0 Times in 0 Posts
Default re: Backup restore

man tar

tar -xzvf home.backup.tgz filename

(replace the word 'filename' above with the file in the tar archive you want to extract. For example, if the mailbox you want to extract is named "vinnie", you would do this:

tar -xzvf home.backup.tgz vinnie

That will leave you with the file "vinnie" in your directory.

Then, to restore it without deleting existing mail that has come in, cat vinnie /var/mail/vinnie > /var/mail/vinnie.tmp

then mv /var/mail/vinnie.tmp /var/mail/vinnie.

Then set the permissions back to what they should be with chown and chmod.

If you are unsure what the filename is in the archive, you can do tar -tzvf home.backup.tgz to get a list, find the file, and do the above. Note that if there is a directory before the file, it will extract it there.
Reply With Quote
Reply

Thread Tools
Display Modes

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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
System-wide backup / restore Zare General 3 October 31st, 2009 01:30
A Restore Test jaymax General 4 September 4th, 2009 06:47
Dump-Restore jaymax General 1 August 20th, 2009 13:58
Trying to restore dumped filesystem... osx-addict General 21 March 15th, 2009 07:03
[Solved] dump/restore failures - help! Weaseal General 15 February 11th, 2009 17:02


All times are GMT +1. The time now is 14:05.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
The mark FreeBSD is a registered trademark of The FreeBSD Foundation and is used by The FreeBSD Project with the permission of The FreeBSD Foundation.