On Mon, 2006-04-17 at 16:01 -0400, Jon LaBadie wrote: > On Mon, Apr 17, 2006 at 01:35:04PM -0600, Tom Schutter wrote: > > I was wondering if anyone can tell be the best way to duplicate an > > Amanda tape on a Linux box. I will have two identical tape drives. I > > would much prefer to use standard UNIX commands. The program "tcopy" > > would be perfect, but it is not available on Debian, it a google search > > indicates that is has problems. > > I would think that "dd" could do the trick, but what is the correct > > incantation? > > > > tcopy was going to be my suggestion until you said you were > not using Solaris :( Is tcopy available on any other OS? > > If you know the tape block size (amanda's is 32K) then > I think it would be: > > dd bs=32k if=/dev/<xxx> of=/dev/<yyy> > > where xxx are the no compression devices or with compression > turned off. > > As I type this I realize that dd will only copy the first > tape file. So this will have to loop. And you will need > to use the no-rewind device. So something like: > > $ mt -f /dev/n<xxx> rewind > $ mt -f /dev/n<yyy> rewind > > $ while dd bs=32k if=/dev/n<xxx> of=/dev/n<yyy> > > do > > : # a colon == no-op command > > done > > dd returns 0 on successful copy, non-zero on failure. > The loop should terminate when the input fails at EOT.
Perfect, just what I needed. For the archives, a slight improvement (so the command is easier to repeat): while dd bs=32k if=/dev/n<xxx> of=/dev/n<yyy> ; do : ; done -- Tom Schutter (mailto:[EMAIL PROTECTED]) Platte River Associates, Inc. (http://www.platte.com)