> Grass users -
> I am sure this is a real basic question, but how does one copy
> a vector or a raster layer to a tape? Since the layers are made up
> of files in different directories, do I have to cpio all the directories
> ie, cell,cellhd,cats, etc? Or is there a simpler way that I just haven't
> discovered?
> Also, does anybody know how to subsribe to the ESRI-L mailing list?
> Thanks in advance.
>
> meh@geog.buffalo.edu
>
>
>
After about 500 requests for "tape of layer x" I wrote a pretty simple
script to make an archive of a raster or vector layer. It uses cpio,
so the archive file is read in using cpio -ivcmud < archivefile.
Here is my (non-robust, non-error-checking, I-should-have-done-it-differently)
script:
#!/bin/sh
# simple program to create archives of raster and vector files -kdg, 23aug93
#
# Usage: g.archive
# What the usage should be:
# Usage: g.archive rast=rasterfile[,rasterfile...] vect=vectorfile[,vectorfile...]
if [ ! -d $LOCATION/.tmp/`hostname` ] ; then mkdir $LOCATION/.tmp/`hostname` ; fi
g.ask type=old prompt="Enter the name of a raster file" element=cell desc="raster (cell) files" unixfile=$LOCATION/.tmp/`hostname`/rastlist$$
. $LOCATION/.tmp/`hostname`/rastlist$$
rastfile=$name
rastmapset=$GISDBASE/$LOCATION_NAME/$mapset
rastpathname=$file
if [ x$rastfile = x ]
then
crast=n
g.ask type=old prompt="Enter the name of a vector file" element=dig desc="vector (dig) files" unixfile=$LOCATION/.tmp/`hostname`/vectlist$$
. $LOCATION/.tmp/`hostname`/vectlist$$
vectfile=$name
vectmapset=$GISDBASE/$LOCATION_NAME/$mapset
vectpathname=$file
if [ x$vectfile = x ]
then
cvect=n
exit 1
fi
fi
if [ x$crast = x ]
then
outdir=`pwd`
echo archiving raster $rastfile from mapset $mapset...
cd $rastmapset
ls cell/$rastfile\
cellhd/$rastfile\
cats/$rastfile\
colr/$rastfile\
hist/$rastfile\
cell_misc/$rastfile/* | cpio -ocvm > $outdir/$rastfile.grc
else if [ x$cvect = x ]
then
outdir=`pwd`
echo archiving vector $vectfile from mapset $mapset...
cd $vectmapset
ls dig/$vectfile\
dig_att/$vectfile\
dig_plus/$vectfile\
dig_cats/$vectfile | cpio -ocvm > $outdir/$vectfile.gvc
fi
fi