From owner-freebsd-questions Sat Jul 21 2:33:57 2001 Delivered-To: freebsd-questions@freebsd.org Received: from everest.wananchi.com (everest.wananchi.com [62.8.64.4]) by hub.freebsd.org (Postfix) with ESMTP id 1569D37B403 for ; Sat, 21 Jul 2001 02:33:51 -0700 (PDT) (envelope-from wash@wananchi.com) Received: from wash by everest.wananchi.com with local (Exim 3.31 #5) id 15Nt8z-000LJH-00 for freebsd-questions@FreeBSD.org; Sat, 21 Jul 2001 12:33:53 +0300 Date: Sat, 21 Jul 2001 12:33:53 +0300 From: Odhiambo Washington To: FBSD-Q Subject: [soleil] Help with variable Message-ID: <20010721123353.K60521@everest.wananchi.com> Mail-Followup-To: Odhiambo Washington , FBSD-Q Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="2/5bycvrmDh4d1IB" Content-Disposition: inline User-Agent: Mutt/1.3.19i X-Disclaimer: My opinions do not necessarily represent those of my employer. X-Operating-System: FreeBSD 4.3-STABLE i386 X-Designation: Systems Administrator, Wananchi Online Ltd. X-Location: Nairobi, KE, East Africa. X-Uptime: 12:21PM up 18:43, 1 user, load averages: 0.06, 0.05, 0.06 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG --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