1833829 Members
2330 Online
110063 Solutions
New Discussion

Re: tar -r

 
Ngoh Chean Siung
Super Advisor

tar -r

Hi,

1st tar backup
tar cvf /dev/rmt/0m /tmp/a.txt

2nd tar backup
tar -r cvf /dev/rmt/0m /tmp/b.txt

Questions:
1) Is the above command and method correct if I want to append the file for the tar backup?

2) I try to man tar and found out this:

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.

May I know what is this statement means?

regards
4 REPLIES 4
Michael Tully
Honored Contributor

Re: tar -r

What the statement actually means is:
If your using a tape, you cannot add a second backup to the tape immediately following the first. You can only use something like an archive that is on disk.

If you wish to append onto tapes cpio can be used.
Anyone for a Mutiny ?
Muthukumar_5
Honored Contributor

Re: tar -r

First command will archieve the /tmp/a.txt file to tape disk.

Second command can not work as stated in the man page " you have referred it as"
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.

We can use this option on disks not tape drives. As stated by tully you can use cpio too for this.

Easy to suggest when don't know about the problem!
Ngoh Chean Siung
Super Advisor

Re: tar -r

Hi,

oic. Just wonder when we will use tar to put data into the hard disk?

regards.
Mohanasundaram_1
Honored Contributor

Re: tar -r

Hi,

I have used
tar -rvf

This successfully appended the file to the tape and the existing data on the tape remains as well.

I was not aware that this is not supported. But when you want to append, you should not use the block size.

Hope this helps.

With regards,
Mohan.
Attitude, Not aptitude, determines your altitude