On Mon, 12 Feb 2001, gary wrote:

> Dear all,
>
> How to use tar command to backup few directories with one command line...
>
> I did tried to use the following to backup,
>
> tar cvbf 20 /dev/st0 ./home
> tar cvbf 20 /dev/st0 ./var
> tar cvbf 20 /dev/st0 ./etc
>
Using /dev/st0, each backup does a rewind after the backup, so the next
tar command overwrites the one before.
>
> but when I tried to restore the tape with
>
> tar xvbf 20 /dev/st0
>
> I only got the last backup for /etc
>
> I also do tried as below to backup...
>
> tar cvbf 20 /dev/nst0 ./home
> tar cvbf 20 /dev/nst0 ./var
> tar cvbf 20 /dev/st0 ./etc
>
> but also get the same thing?
>
> anyone know about this, please help to advise...
>
The tar command to /dev/st0 should rewind to the beginning of the tape.
Are you shure the restore showed ./etc, and not ./home?  You also have
to use /dev/nst0 when doing the restore.

You can also use the mt command to control the tape drive.
>
> My main purpose is just to backup those 3 directories and make sure the
> backup and restore work properly...
>
> many thanks.....
>
> best rdgs,
> gary
>
As Jason P Holland said, you can put all three directories in one
command line.  But putting three archives on one tape also works, as
long as you use the non-rewinding device.  (/dev/nst0).

Mikkel
-- 

    Do not meddle in the affairs of dragons,
 for you are crunchy and taste good with ketchup.




_______________________________________________
Redhat-list mailing list
[EMAIL PROTECTED]
https://listman.redhat.com/mailman/listinfo/redhat-list

Reply via email to