Backup and Restore with TAR
Really, really new to Linux so sorry if this is obvious and I've missed it. I'm using SuSE 9 and I want to backup my home folder to tape which I've managed with
tar -cvf /dev/st0 /$HOME This shows me all the files being backed up and my tape spins giving me the impression that its writing. My Question: How do I get my files back? How can I verify the data is there? Thanks in advance |
You could try
tar -tvf /dev/st0 which should list the filenames (t = table of contents) or tar -xvf /tmp/test /dev/st0 which should extract the files into /tmp/test if you want to compare sizes/checksums etc. Make sure the tape is rewound first. I've tended to use taper (http://sourceforge.net/projects/taper/) as it has a nice (curses) based interface and is pretty stable. It's up to v7. I suggest you try it out as it's free. |
To get the files back just apply the tar to extract the files.
--> tar xvf /dev/st0 To access the tape, work with the command "mt". Look up the different commands available in the man pages ("man mt"). Some examples: - mt /dev/nrst0 rewind --> rewind the tape - mt dev/nrst0 fsf 1 --> to the next file on the tape - mt dev/nrst0 fsf --> skip to files (go to next but one file) If you're using the driver st0, the tape will rewind after each backup. If you want to avoid these, e.g you want to put several backups on the tape one after one, use the driver nrst0. This driver won't automatically rewind the tape. The command mt should always be used with the nrst0 driver only. |
so quick
you see, this is why Apple Macintosh will always rule. You post a question on a Mac forum and it gets answered before you can work it out for yourself.
The answer is simply tar -xvf /dev/st0 which restores all data to /root Thanks me |
sorry
And whilst I was writing my findings two nice people have given me new things to try! OK so Linux might not be that bad ;)
Thanks for imput guys, very useful, downloading taper now! |
Re: so quick
Quote:
Quote:
|
You may also want to save space by compressing the file.
Learn about zip & unzip, gzip & gunzip, or bzip2 & bunzip2. I think there is a way to compress and uncompress using tar - others may know. Sheng-Chieh |
Quote:
E.g: "tar cvzf tar-file.tar.gz files" you create a gzipped tar archive. (".tar.gz" is the same as ".tgz") |
All times are GMT -5. The time now is 12:24 PM. |