Operating System - HP-UX
1825805 Members
2373 Online
109687 Solutions
New Discussion

Re: Can I maintain multiple TAR BACKUP of the same data onto the same tape without overwriting ?

 
Yaboto
Super Advisor

Can I maintain multiple TAR BACKUP of the same data onto the same tape without overwriting ?

Hi,

I have an existing TAR BACKUP on a tape. If I should perform again the same TAR BACKUP of the same data onto the same tape, will the old data be overwritten ?
Can I TAR backup the same data two times onto the same tape without overwriting the older one ?
Please help.

Regards,
Mawuena
8 REPLIES 8
Hasan  Atasoy
Honored Contributor

Re: Can I maintain multiple TAR BACKUP of the same data onto the same tape without overwriting ?

hi mawuena ;


tar rvf /dev/rmt/omn yourfile_dir


Hasan
Hasan  Atasoy
Honored Contributor

Re: Can I maintain multiple TAR BACKUP of the same data onto the same tape without overwriting ?

- no points for this thread to me pleae.
previous answer is wrong since tar rvf does not support for tape .

Hasan
Murat SULUHAN
Honored Contributor

Re: Can I maintain multiple TAR BACKUP of the same data onto the same tape without overwriting ?

Hi

tar backup version1
mt fsr
tar backup version2
mt fsr
....
...
...


do not use rewind type of tape device

Best Regards
Murat
Murat Suluhan
Eric SAUBIGNAC
Honored Contributor

Re: Can I maintain multiple TAR BACKUP of the same data onto the same tape without overwriting ?

Bonsoir Mawuena,

Yes you can do that by using drivers like /dev/rmt/0mn instead of /dev/rmt/0m and command mt.

- driver /dev/rmt/0mn does not rewind the tape after closing.

- mt gives you the possibility to forward/backward from tape files to tape files on the tape.

- you must think in terms of "tape file" for each tar backup. That is : one tar = one tape file.

Now, suppose you make your first backup like this :

# mt -f /dev/rmt/0mn rew --> rewind the tape
# tar cvf /dev/rmt/0mn --> do the first backup

Now, you want to do a second backup, without overwriting the first one :

# mt -f /dev/rmt/0mn rew --> rewind the tape
# mt -f /dev/rmt/0mn fsf 1 --> Skip first "tape file", in other words, skip first tar.
# tar cvf /dev/rmt/0mn --> do the second backup

Now you want to do a third backup :

# mt -f /dev/rmt/0mn rew --> rewind the tape
# mt -f /dev/rmt/0mn fsf 2 --> Skip two "tape file", in other words, skip tar number 1 and number 2
# tar cvf /dev/rmt/0mn --> do the third backup

Restore the second tar :

# mt -f /dev/rmt/0mn rew --> rewind the tape
# mt -f /dev/rmt/0mn fsf 1 --> Skip first backup
# tar xvf /dev/rmt/0mn [] --> restore the second backup.

And so on ...

The problem is that you must know exactly what is on your tape ...

Regards

Eric
Bill Hassell
Honored Contributor

Re: Can I maintain multiple TAR BACKUP of the same data onto the same tape without overwriting ?

Actually, the *only* dependable device files for tape positioning are the Berkeley device files. (see man mt) These device files will have a trailing "b" in the name and lssf /dev/rmt/* will report Berkeley rather than AT&T. The AT&T device files are not suited for precise tape manipulation.

However, while you can append a tar backup to the end of a previous backup, it is a terrible idea. One mistake and you wipe out all of your backup data with no way to recover. And without very accurate records, there is no way to tell what is on the tape without a lot of work. And you can't really tell when you are going to run out of tape. TAR simply aborts leaving an incomplete record at the end of the tape.

For a test box or playing around at home, you can experiment but for production, it is a very unstable way to backup data.


Bill Hassell, sysadmin
Lexxx
Advisor

Re: Can I maintain multiple TAR BACKUP of the same data onto the same tape without overwriting ?

you can do tar -rv
OldSchool
Honored Contributor

Re: Can I maintain multiple TAR BACKUP of the same data onto the same tape without overwriting ?

"you can do tar -rv "

nope...not to *tape*. from "man tar"

r

Add the named file to the end of the archive. The same blocking factor used to create the archive must be used to append
to it. This option cannot be used if the archive is a tape.

As noted previously, it can be done, but you need to keep track of the file positions yourself. The only time I've ever done anything like this was when I was archiving several different directories of CAD files. One directory per archive and they were written sequentially to a non-rewind device.

I've never tried to append a new archive to an existing tape, as tapes are cheap and the consequences of an "off-by-one" error when appending are, potentially, disasterous.
Steven Schweda
Honored Contributor

Re: Can I maintain multiple TAR BACKUP of the same data onto the same tape without overwriting ?

> The problem is that you must know exactly
> what is on your tape ...

> the consequences of an "off-by-one" error
> when appending are, potentially,
> disasterous.

It's been a long time since I used "tar" for
any serious backup work, but, as I recall, it
was pretty easy to use either "tar t" or
"mt fsf" to space ahead repeatedly until an
error status was returned. At that point, a
potential disaster seems pretty unlikely
(assuming that you aren't using a rewinding
tape device). Count 'em if you have doubts.

What I _do_ use regularly is VMS BACKUP
(which includes a /[NO]REWIND qualifier and
named save sets), and it's hard not to feel
smug about it. I routinely put about a
month's worth of daily incremental backups
onto one DLT cartridge. I'd be really
annoyed if I had to change that tape every
day. (Or if I had to guess which save set on
it went with any particular date.)