Operating System - HP-UX
1834415 Members
1745 Online
110067 Solutions
New Discussion

Backup and restore with tar

 
SOLVED
Go to solution
rana786
Regular Advisor

Backup and restore with tar

Hi there,

I like to take backup some of our file system using “tar” and append data daily basis in same cartridge but I did not find any parameter in man page. would you please check that whether it is possible or not.

Here I like to mention that from this backup I have to restore frequently so please give me the total procedure of backup(with append) and restore.

Mostafa

Walker_dhk
4 REPLIES 4
Julio Yamawaki
Esteemed Contributor

Re: Backup and restore with tar

Hi,

To append a backup in a tape with tar use mt command.
For example, in the first time, just use tar cvf /dev/rmt/xm /backup
second time:
mt -t /dev/rmt/xm fsf 1 --> 1 indicates first tape mark and so on 2,3,4...
after mt, just use tar cvf, but be very carefull, because every time you tar something to tape, if you use xm tape will rewind and the next time you want to write something, you must use mt first.

Regards,
Victor Fridyev
Honored Contributor

Re: Backup and restore with tar

Hi,

I'm not sure that a backup on a tape using tar is good idea, especially if you want to add files daily. The problem is not in the backup, the problem is in restore. You have to know which tar file on the tape contains the file which you like to restore. In order to know that, you have to support a database with a list of backed up files etc.
Theoretically it's interesting and relatively simple to create such a backupsystem, but practically it's much easier and not very expensive to buy something like backupexe or similar.

HTH
Entities are not to be multiplied beyond necessity - RTFM
Ivan Ferreira
Honored Contributor
Solution

Re: Backup and restore with tar

Use the no rewind /dev/rmt/Xmn device:

First backup:

tar cvf /dev/rmt/0mn

Second backup

tar cvf /dev/rmt/0mn

Restore first backup

mt -f /dev/rmt/0mn rewind

tar xvf /dev/rmt/0mn

Restore second backup

mt -f /dev/rmt/0mn fsf 1

tar xvf /dev/rmt/0mn


And so on...
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
rana786
Regular Advisor

Re: Backup and restore with tar

Its ok.
Walker_dhk