Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 21 Jul 2001 12:33:53 +0300
From:      Odhiambo Washington <wash@wananchi.com>
To:        FBSD-Q <freebsd-questions@FreeBSD.org>
Subject:   [soleil] Help with variable
Message-ID:  <20010721123353.K60521@everest.wananchi.com>

next in thread | raw e-mail | index | archive | help

--2/5bycvrmDh4d1IB
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

I am having a problem with a crontab entry. It's not so complicated but a
variable seems not to work for me.

Here is my crontab file (extracted from /var/cron/tabs) ;-)

###################

SHELL=3D/bin/sh
PATH=3D/etc:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin://usr/local/sbin
HOME=3D/home/wash/Administration/logs
FILE=3D/home/wash/Administration/Domains/
FILE2=3D/home/wash/possible-spam.log
DATE=3D"`/bin/date +"%w"`"
SQUID=3D"/usr/local/squid/logs/access.log"
# Generate reports from Squid logs for analysis.
CAL=3D"/usr/local/bin/calamaris"
CALAMARIS1=3D"/usr/local/bin/calamaris -a -p new -mH"
# Generate Squid cache summaries for later use.
CALAMARIS2=3D"/usr/local/bin/calamaris -a -o"
# Now get Weekly Statistics
#STATS=3D"if [ $DAYOFWEEK =3D "0" ];  then  /usr/local/bin/calamaris -a -i =
daily.1:daily.2:daily.3:daily.4:daily.5:daily.6:daily.0 -zmH "Weekly Squid =
Report" | mail wash tole fi"
#E-mail domain registrations to Cherotich every first Thursday of every mon=
th at#6.00 am
15	14	*	*	5	sh $FILE/mailinfo.sh
15	4	*	*	6	cp -f /dev/null $FILE2
30	12	*	*	*	cat $SQUID | nice -39 $CALAMARIS1 | mail wash@wananchi.com tole=
@wananchi.com=20
25	12	*	*	*	cat $SQUID | nice -39 $CALAMARIS2 daily.$DATE > /dev/null
50	12	*	*	*	if [ $DAYOFWEEK =3D "0" ];  then $CAL -a  -i daily.1:daily.2:da=
ily.3:daily.4:daily.5:daily.6:daily.0 -zmH "Weekly Squid Report" | mail adm=
in@wananchi.com fi"


Everytime the cron fails to run with this error

"Can't open +"%w"`: No such file or directory"

That is something to do with my date variable.

On the command line when I try date=3D"`/bin/date +"%w"`" and do echo $date
I get the correct thing. I use bash but when I use sh as my shell I also
get the correct thing.=20


Where am I going wrong? Someone please help me.


MTIA

-Wash

--
Odhiambo Washington
Wananchi Online Ltd.,
wash@wananchi.com 1st Flr Loita Hse.
Tel: 254 2 313985 Loita Street.,
Fax: 254 2 313922 PO Box 10286,00100-NAIROBI,KE.

I'm very old-fashioned. I believe that people should marry for life, like=
=20
pigeons and Catholics.=20
-Woody Allen=20

--2/5bycvrmDh4d1IB
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (FreeBSD)
Comment: For info see http://www.gnupg.org

iD8DBQE7WUyBn7LIsuxjem8RAgU+AJ96w7+uAzjry7cVOXajzvbtbSu25gCfXsrq
PUlMEIAUxanywSr1qVxXHxw=
=wQv8
-----END PGP SIGNATURE-----

--2/5bycvrmDh4d1IB--

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010721123353.K60521>