Path: utzoo!utgpu!water!watmath!clyde!bellcore!decvax!decwrl!sun!sears From: sears@sun.uucp (Daniel Sears) Newsgroups: comp.sys.ibm.pc Subject: Re: MKS: multi-volume backups. Keywords: tape drives, cpio, dd Message-ID: <41543@sun.uucp> Date: 10 Feb 88 19:04:07 GMT Organization: Sun Microsystems, Inc. - Mtn View, CA Lines: 72 Here are two scripts that I use to split and reassemble large files (2-10Mb). Maybe you can modify them for archiving. This brings me to a related subject. Floppy disks, even of the 1.2 megabyte variety, are too small for backup or file transfer of large files. I would be interested in hearing from people who use the MKS Toolkit with tape drives and streamers. --Dan #! /bin/sh # This is a shell archive, meaning: # 1. Remove everything above the #! /bin/sh line. # 2. Save the resulting text in a file. # 3. Execute the file with /bin/sh (not csh) to create: # split.ksh # unsplit.ksh # This archive created: Wed Feb 10 11:03:33 1988 export PATH; PATH=/bin:/usr/bin:$PATH if test -f 'split.ksh' then echo shar: "will not over-write existing file 'split.ksh'" else cat << \SHAR_EOF > 'split.ksh' # # split.ksh -- split a file into 1Mb chunks with dd(1) # usage sh split.ksh "input file" # chunks=$(ls -l $1 | awk '{ t = int($3/1000000 + 1) ; for(i=1; i<=t; i++) printf("%d ", i) }') offset=0 for i in $chunks do echo "change diskettes and press " read dd if=$1 of=a:$i.bak bs=1024 skip=$offset count=1000 offset=$(echo $offset | awk '{printf("%s", $0 + 1000)}') done SHAR_EOF fi if test -f 'unsplit.ksh' then echo shar: "will not over-write existing file 'unsplit.ksh'" else cat << \SHAR_EOF > 'unsplit.ksh' # # unsplit.ksh -- assemble a file from chunks with dd(1) # usage sh unsplit.ksh "n chunks" "input file" # chunks=$(echo $1 | awk '{ for(i=1; i<=$0; i++) printf("%d ", i) }') offset=0 for i in $chunks do echo "change diskettes and press " read dd if=a:$i.bak of=$2 bs=1024 seek=$offset count=1000 offset=$(echo $offset | awk '{printf("%s", $0 + 1000)}') done SHAR_EOF fi exit 0 # End of shell archive -- Daniel Sears Sun Microsystems, Inc. Technical Publications MS 5-42 (415) 691-7435 2550 Garcia Avenue sears@sun.com Mountain View, CA 94043