Article 110 of unix-pc.sources: Path: tut.cis.ohio-state.edu!mandrill!gatech!rutgers!labrea!agate!ucbvax!ihnp4!ihopa!ihop3!booboo!spear From: spear@booboo.UUCP (Steve Spearman) Newsgroups: unix-pc.sources Subject: ccpio - do compressed backups Message-ID: <33@booboo.UUCP> Date: 4 Jun 88 13:22:39 GMT Distribution: unix-pc Organization: His Mile High Home Computer Lines: 119 Here are the scripts mentioned in unix-pc.general for doing compressed cpio's and recovering them. Sorry, I couldn't find my shar program so you'll have to manually extract them. These assume cpio's to the floppy, so you don't have to specify the source/destination. But it takes most other cpio flags. Steve Spearman (ihnp4, att, ihtlt)!booboo!spear ----cut here for ccpio---- #ccpio - do compressed cpio trap "rm -f /tmp/ccpio.$$* ; /etc/dismount -f ; exit 1" 1 2 13 15 tmp=/usr/spool/uucppublic/ccpio.sofar tmpnum=/usr/spool/uucppublic/ccpio.nsofar cont=false format=false while [ "$1" != "" ] do case "$1" in -c ) cont=true ;; -f ) format=true ;; esac shift done if [ "$cont" = true ] then if [ ! -s $tmp -o ! -s $tmpnum ] then echo "Both $tmp and $tmpnum must exist in order to continue!" exit 1 fi echo "\nccpio is using a pre-existing $tmp file...\n" diskno=`cat $tmpnum` echo "Put in disk # $diskno and hit ...\c" read a else if [ -s $tmp ] then echo "There is a pre-existing $tmp file." echo "If you want to continue with it, invoke 'ccpio -c'." echo "Otherwise, remove it and re-start 'ccpio'." exit 1 fi # grab the list of files cat - > $tmp echo 1 > $tmpnum diskno=`cat $tmpnum` rm -f /tmp/ccpio.disk* fi go=true echo "\n`wc -l < $tmp` files are going to be written ...\n" while $go do again=true while $again do if [ "$format" = true ] then echo "Formatting disk # $diskno ..." ; formatflop fi #check the disk data size SIZE=`iv -t /dev/rfp020 | grep "Partition 1"| cut -f3 -d=` if [ $SIZE -ne 316 -a $SIZE -ne 395 ]; then echo "WARNING: unknown disk size $SIZE, assuming 316" SIZE=316 fi echo "Writing disk # $diskno (size $SIZE blocks)..." cpio -co < $tmp 2> /tmp/ccpio.$$2 | compress | dd of=/dev/rfp021 obs=1024 count=$SIZE 2>/dev/null echo "Reading back ..." # read back what we just put on the disk, to verify it and # to see what the last complete file was uncompress < /dev/rfp021 | cpio -cit 2>/dev/null > /tmp/ccpio.disk$diskno lastfile=`tail -1 /tmp/ccpio.disk$diskno` echo "Last file written: $lastfile" lineno=`grep -n "^$lastfile\$" < $tmp | sed -e 's/:.*//' ` if [ "$lineno" = "" ] then #try the case of a ./ directory at the head lineno=`grep -n "^\./$lastfile\$" < $tmp | sed -e 's/:.*//' ` fi if [ "$lineno" = "" ] then echo "Something went wrong! Try writing again? Press " choice=`line /tmp/ccpio.$$x mv /tmp/ccpio.$$x $tmp if [ `cat $tmp | wc -l` -ne 0 ] then echo "`wc -l < /tmp/ccpio.disk$diskno` files written on disk $diskno, `wc -l < $tmp` files to go." diskno=`expr $diskno + 1` echo $diskno > $tmpnum echo "\nTo continue - insert floppy disk #$diskno and press the key." choice=`line