Discussion Locked

backup newbie

0 helpful
7 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I am starting to use linux tar to program backups to tape drives. I dont understand how to make successive backups of different directories on the tape. It seems like only the last tar stays on tape. For example, if I do

tar cvf /dev/tape /home
tar cvf /dev/tape /etc

only the files archived in the last tar (/etc) show up when I generate a list with

tar tvf /dev/tape

as if the first tarred files (/home) were overwritten. I was expecting to see the files from /etc and /home as well in the tape archive. What am I doing wrong or not understanding? I also tried the A and r options (append) instead of c (create) but that did not work either. Any help would be greatly appreciated.

7 replies

by true_texan

It's been a while since I worked with UNIX, but might try:

tar cvf /dev/tape /home /etc

I think the tar command automatically rewinds at the end of the command. There is a command in UNIX to force the tape to skip filesets, but I can't remember the command. You might check the man pages.

Hope this helps!

by gctr

It's actually the device that specifies that the tape rewinds after each operation. On my machine if I do "ls -l /dev/*st0" it shows a couple of different devices but they both refer to the same physical device. The st0 device will rewind after every operation and the nst0 device will not (n refers to norewind). You can use the mt program to rewind the tape or fast forward it. There might be other letters prepended to the device to allow you to use tape compression or a raw mode.

by petronil

When i'm using tar i usually issue a single line command to all files and directories that i want to compress and backup. try this one

tar czvf /dev/tape /home /etc

good luck

This discussion is closed to new replies.