PDA

View Full Version : How to restore backup in linux taken by TAR Command


kharmale_anil
Jul 18, 2008, 11:18 PM
Hiiiii
I'm new in linux. In my office I have taken baukup of Oracle data using Tar files. Now my mangaer tell me to resotre one of the data from tape. So can you tell the command for restornig backup.

Usually for backup I use command
Tar -rvf /dev/st0 /Folder name

gctts
Aug 23, 2008, 07:13 PM
You can retrieve the files by mounting the CD and copying the files from CD to hard drive using the cp command

Cp /dev/st0 (mine are on use dev/cdrom so use whatever device yours is called) new.location (for new.location, use whatever directory you want it in)

Move to the directory you copied the tar files to:
Cd whatever directory you put the tar file in
Tar -xp filename.tar

pauline896
Aug 29, 2008, 04:19 PM
you can retrieve the files by mounting the CD and copying the files from CD to hard drive using the cp command

cp /dev/st0 (mine are on use dev/cdrom so use whatever device yours is called) new.location (for new.location, use whatever directory you want it in)

move to the directory you copied the tar files to:
cd whatever directory you put the tar file in
tar -xp filename.tar
================================================== =========
widecircles (http://blog.widecircles.com)
pauline

kharmale_anil
Sep 10, 2008, 11:28 PM
[
Hiiii
Thanks for the reply

Actulayy size of backup file which is on tape is more than 10GB. And this file was deleted from my syatem. And now I want to retrive that file from tape to Hard disk. So please tell me the command line so that I can easily restore the file form Tape to Nachine.

Thanks






QUOTE=pauline896]you can retrieve the files by mounting the CD and copying the files from CD to hard drive using the cp command

cp /dev/st0 (mine are on use dev/cdrom so use whatever device yours is called) new.location (for new.location, use whatever directory you want it in)

move to the directory you copied the tar files to:
cd whatever directory you put the tar file in
tar -xp filename.tar
================================================== =========
widecircles (http://blog.widecircles.com)
pauline[/QUOTE]

derobert
Sep 14, 2008, 03:25 AM
You can use tar to read the tape if it was written by tar.

e.g. tar xf /dev/st0

I'd suggest setting the read-only tab on your tape if it has one.

Hopefully however you backed up the Oracle files, you did it correctly. Just taring up the Oracle data dir usually isn't the right way.

kharmale_anil
Sep 15, 2008, 11:28 PM
Thanks for reply...
Its done. I have restore file successfully using tar xf /dev/st0 this command, thanks very much.
Now I want help that can I delete unnecessary backup files from tape? If so please give me the command line for the same?

Thanks
Anil




QUOTE=derobert]You can use tar to read the tape if it was written by tar.

e.g. tar xf /dev/st0

I'd suggest setting the read-only tab on your tape if it has one.

Hopefully however you backed up the Oracle files, you did it correctly. Just taring up the Oracle data dir usually isn't the right way.[/QUOTE]

derobert
Sep 16, 2008, 05:55 PM
Tape doesn't work like that. It isn't a file system. You can erase the tape, or just write over it, but you don't add and delete files like you do a file system.

If you want to write over it, just use your original tar command — that'll overwrite the tape. If you need to erase it (e.g. for security reasons), you can (depending on tape type) use either a bulk eraser or something like dd if=/dev/urandom of=/dev/st0 bs=32768 (and repeat as many times as your security needs require).

I strongly suggest learning more about how tape operates if you're going to rely on them. I don't know of a good reference off the top of my head, unfortunately. Also, as a backup strategy, tar is rather lacking in features; there are plenty of backup packages that'll make like much easier. Personally, I use Bacula, but that's an overkill for a single machine.

Edit: Also, no backup strategy should be trusted until you've done at least one restore!