Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

tar help for a beginner 2

Status
Not open for further replies.

SassiSmalltalk

Technical User
Jun 2, 2005
6
GB
I have managed to create a tar file but it is not doing what I need and any help would be appreciated.

I have a directory that I want to back up to a tape using a tar file. The directory will be backed up ONCE A WEEK to the SAME tape. The files in the directory will have the same name but the content and date modified will have changed.

The command I am currently using is
tar -cvf /dev/rmt/0m /backup
This works and I get a tar file on my tape but the following week it overwrites. There is a -A option but I am not sure how or if this will work, and how the restore will work. I would like to be able to choose which week is restored, and not always the last week added.

Hope this makes sense, and many thanks in advance for any help

Sassi
 
tar -cvf /dev/rmt/0n
n is no rewind do man tar.


CA
 
Dear CA

You are a Gem. This works like a wee sweetie. Thank you so much.

When I use tvf it lists the first tar I created. Each time I type tvf it shows the next set and so on. I take it to restore a certain set I would tvf until it lists the file I want to restore then the standard xvf will restore that set?

Many thanks again

Sassi

ps
I like solaris
 
There are some magnetic tape commands (mt) which would make the job easier (see the man pages) and quicker. Each tar produces a file on the tape. To do the restore you must be at the beginning of the tar file. So if you have just done a tar tvf /dev/rmt/0n you will be at the end of the tar file you want to restore (or more specifically at the beginning of the next tar file on the tape).
What I would do is (provided you know how many tar files are on the tape):
mt -f /dev/rmt/0n fsf <n> # where <n> is 1 less than the number of the file you want to restore
tar xvf /dev/rmt/0n

I hope that helps.

Mike
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top