From: "Dylan A. Loomis" <dylan@aero.org> To: Martin Lilienthal <webmaster@webdesign4free.de> Cc: freebsd-questions@FreeBSD.ORG Subject: Re: Help with Shell Script..... Message-ID: <19990805110703.B14296@rush.aero.org> In-Reply-To: <199908051625.LAA13061@db.geocrawler.com>; from Geocrawler.com on Thu, Aug 05, 1999 at 09:25:11AM -0700 References: <199908051625.LAA13061@db.geocrawler.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, Aug 05, 1999 at 09:25:11AM -0700, Geocrawler.com wrote: > This message was sent from Geocrawler.com by "Martin Lilienthal" <webmaster@webdesign4free.de> > Be sure to reply to that address. > > I need some help with writing a Shell-Script. > (I`m not very experienced with writing these Scripts.) > The Script should be started by cron to create access-statistics for our website. > The command to start the analizer is: > > webalizer -o admin/stats logs/access.log.XX > > XX is the number of the week. For example the full name of the access-log > is: access.log.31 . How can I force the script, that it automaticalliy > changes the logfile-name? > > regards, Martin > > Geocrawler.com - The Knowledge Archive > > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-questions" in the body of the message Martin, $ date +%U Will print out the week of the year 00-53 accd'ing to strftime(3) man page. So there are a number of ways to do it: try the short way just add this to the crontab: webalizer -o admin/stats logs/access.log.`date +%U` Or the long way create a shell script like: -- begin test.sh -- #! /bin/sh week=`date +%U` webalizer -o admin/stats logs/access.log.${week} -- end test.sh -- And add the shell script to the crontab. hope that helps -DAL- -- Dylan A. Loomis Computer Systems Research Department The Aerospace Corporation e-mail: dylan@aero.org phone: (310) 336-2449 PGP Key fingerprint = 55 DE BB DD 34 10 CD 20 72 79 88 FE 02 0E 21 3A PGP 2.6.2 key available upon request 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?19990805110703.B14296>