Date: 23 Jul 2003 02:15:11 -0400 From: Joe Marcus Clarke <marcus@marcuscom.com> To: David.Bear@asu.edu Cc: FreeBSD User Questions List <freebsd-questions@freebsd.org> Subject: Re: shell script help Message-ID: <1058940911.28333.25.camel@shumai.marcuscom.com> In-Reply-To: <20030722230432.J27866@asu.edu> References: <20030722230432.J27866@asu.edu>
next in thread | previous in thread | raw e-mail | index | archive | help
--=-rFOSY5qzPRB2Ri5Wvtif
Content-Type: text/plain
Content-Transfer-Encoding: quoted-printable
On Wed, 2003-07-23 at 02:04, David Bear wrote:
> I'm trying to clean up a script that controls my tape better. Among
> other things it sets some variable to use later. I've made an error
> somewhere and I'm thinking that I'm missing the obvious since I cant
> find the error. I want to set command line options for tar. Below
> taroptions has what I want. Line 12 echo's the command. When I use
> what line echo's to the console tar works. However, something is
> happening with line 13 that makes tar mad. It tells me=20
>=20
> tar can't open the archive /dev/sa0 /var/log
>=20
> Please advice -- I'm going blind trying understand this one.
>=20
>=20
> 1 #!/bin/sh
> 2 PATH=3D/bin:/usr/bin
> 3 backupadmin=3D"iddwb@asu.edu"
> 4 starttime=3D`date "+DATE: %Y-%m-%d%nTIME: %H:%M"`
> 5 wrkdir=3D"/root"
> 6 tmpfile=3D${wrkdir}"/cat.tmp"
> 7 curfile=3D${wrkdir}"/tapelabel"
> 8 catalog=3D${wrkdir}"/level1Tar.cat"
> 9 datetime=3D`date "+DATE: %Y-%m-%d%nTIME: %H:%M"`
> 0 taroptions=3D"--create --verbose --block-size 1 --read-full-blocks --bl=
ock-compress --gzip --file "
> 1 tapedev=3D"/dev/sa0"
> 2 echo "tar "${taroptions}${tapedev}" /var/log " =20
> 3 tar ${taroptions}${tapedev}" /var/log " =20
> 4 exit
How about:
0 taroptions=3D"--create --verbose --block-size 1 --read-full-blocks
--block-compress --gzip --file"
1 tapedev=3D"/dev/sa0"
2 echo "tar ${taroptions} ${tapedev} /var/log"
3 tar ${taroptions} ${tapedev} /var/log
Works for me.
Joe
--=20
PGP Key : http://www.marcuscom.com/pgp.asc
--=-rFOSY5qzPRB2Ri5Wvtif
Content-Type: application/pgp-signature; name=signature.asc
Content-Description: This is a digitally signed message part
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (FreeBSD)
iD8DBQA/Hifvb2iPiv4Uz4cRAvQyAKCEv1zLqvf52Y3at5qyN4zIwNKY+gCeK9NA
rJZT8dLoYzQxBo4C2XFQsXA=
=hjAQ
-----END PGP SIGNATURE-----
--=-rFOSY5qzPRB2Ri5Wvtif--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1058940911.28333.25.camel>
