System Administration
cancel
Showing results for 
Search instead for 
Did you mean: 

tar file without remove existing data

 
heaman1
Regular Advisor

tar file without remove existing data

I want to use tar command to backup file ,( tar -cvf device file ) , but I found that if I use this command , it will overwrite / remove the existing data in the tape ( the data is created by other tools , not tar ) , can advise how can I keep the existing data if I use tar backup ? thx
12 REPLIES
Steven Schweda
Honored Contributor

Re: tar file without remove existing data

1. Use a non-rewinding tape device.

2. If the tape is not at its end-of-tape
position when you want to do the "tar"
operation, then use "mt fsf" to space forward
until it is.

man mt
man 7 mt

Re: tar file without remove existing data

If you are going to be playing tricky games like this, are you going to remember how to restore the files?
heaman1
Regular Advisor

Re: tar file without remove existing data

thx replies ,

hi Dennis Handly ,

how do you mean ? you mean I may be unable to restore the file if I use this method to backup ? thx

Re: tar file without remove existing data

>you mean I may be unable to restore the file if I use this method to backup?

No, you can restore your data but only if you remember the series of commands to do so.
mt -f /dev/rmt/0mn fsf
tar -xf /dev/rmt/0mn
James R. Ferguson
Acclaimed Contributor

Re: tar file without remove existing data

Hi:

Tape is so cheap compared to the value of being able to successfully recover a lost or corrupt file. In my opinion, playing tape-positioning games to save few tapes is like playing Russian Roulette with a loaded gun: sooner or later someone loses.

Regards!

...JRF...
Durvesh Mendhekar
Regular Advisor

Re: tar file without remove existing data

Hi,

You can use tar -u command.

regards,
Durvesh
OldSchool
Honored Contributor

Re: tar file without remove existing data

"You can use tar -u command."

I've never tried such and wouldn't recommend it for use with tape anyway (for the reasons noted previously). Also of note was the OP specified the other data on the tape was written by an application other than "tar", so there isn't anything to "update"
Durvesh Mendhekar
Regular Advisor

Re: tar file without remove existing data

Hi,

Use fbackup instead of tar as fbackup have more features.

http://forums13.itrc.hp.com/service/forums/questionanswer.do?threadId=663262&admit=109447627+1245161973650+28353475

Regards,
Durvesh
Steven Schweda
Honored Contributor

Re: tar file without remove existing data

> If you are going to be playing tricky
> games [...]

> In my opinion, playing tape-positioning
> games [...]

You know, on VMS, where BACKUP uses _named_
save sets, and offers a /[NO]REWIND
qualifier, people do things like this every
day without a care, and no one thinks that
he's playing any kind of game, tricky or
otherwise. Strange as it may seem.

For example, my nightly incremental backup
tape holds about a month's worth of stuff, so
I don't need to load a new tape daily. And
if I want to see something from last Friday,
I just ask for "I09612".

It'll be a sad day when HP finally completes
the job of killing it off.

Re: tar file without remove existing data

>>existing data in the tape (the data is created by other tools, not tar),

>Steven: on VMS, where BACKUP uses _named_
save sets, and offers a /[NO]REWIND
qualifier, people do things like this every
day without a care,

Will VMS handle multiple applications appending to the tape?

I know that IBM or ANSI labeled tapes would provide some measure of protection.

But that didn't stop me from destroying my tape N decades ago when I mistakenly told the operator to "go ahead", when I had the sequence number wrong.
Steven E. Protter
Exalted Contributor

Re: tar file without remove existing data

Shalom,

tar -rvf # updates an existing tar file with new data.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Steven Schweda
Honored Contributor

Re: tar file without remove existing data

> Will VMS handle multiple applications
> appending to the tape?

I don't see why not, if they do things the
normal way.

> I know that IBM or ANSI labeled tapes would
> provide some measure of protection.

BACKUP makes ANSI-labeled tapes. VMS
resembles a real operating system this way.

HELP MOUNT /LABEL:

[...]
/LABEL (default)
/NOLABEL

Indicates that the volume is in the standard format used by the
OpenVMS operating system; that is, a magnetic tape volume is in
the standard ANSI format, or a disk volume is in Files-11 format.
[...]