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

how to append a new backup without overwriting existing ?

Maaz
Valued Contributor

how to append a new backup without overwriting existing ?

I took backup on tape, via
# tar -czf /dev/st0 /home

and check/list via
# tar -tzf /dev/st0

ok, but when I try to create another backup on tape, via
# tar -czf /dev/st0 /data
then the previous backup(/home) gone.
# tar -tvf /dev/st0
only shows /data, and not /home.

and I want both /home and /data backup on tape.

please help
Regards
4 REPLIES
Ivan Ferreira
Honored Contributor

Re: how to append a new backup without overwriting existing ?

You must use the /dev/nst0 so you won't rewind your tape. Then you must use the mt fsf command to move between the backup copies on tape:

http://hep.uchicago.edu/cdf/howto/TapeArchiving.html
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
Dennis Handly
Acclaimed Contributor

Re: how to append a new backup without overwriting existing ?

>how to append a new backup without overwriting existing?

This is very dangerous (error prone) and you don't want to do this. If you successfully put it on your tape, you'll need to remember how to get it off. If you have N backups, then how will you remember what's where?

>I want both /home and /data backup on tape.

You can put both there in the same pass:
tar -czf /dev/st0 /home /data
Ivan Kuznetsov
Frequent Advisor

Re: how to append a new backup without overwriting existing ?

tar -rzf /dev/st0 /data
Appends /data to the end of the archive
Dennis Handly
Acclaimed Contributor

Re: how to append a new backup without overwriting existing ?

>Ivan: tar -rzf /dev/st0 /data
Appends /data to the end of the archive

Unless GNU tar -r is different than HP-UX, you can't use -r with tapes.