|Apr 19, 2003, 03:29 PM||#1|
Calling all UNIX gurus...
My web host runs Apache. I'm trying to set up a cgi script that basically gives a graphical analysis of my referrer logs. My host names the logs like this:
The suffix is assigned server-wide, not just on my account, which is why the numbers skip around. So anyway, what I want to do is write a cron job to copy the most recent log file to another file called referrer_log. My problem lies in selecting the right file to copy. How do I tell the server to select only the most recent log, and only if it's not already gzip'd?
Any help would be greatly appreciated...
|Apr 19, 2003, 03:57 PM||#2|
Hmm, the question is a bit vague. a really ugly way to do this from the command line that should work is:
cp `ls -ut1 referrer_log.?????????? | head -n 1` referrer_log
What you should actually do is find your favorite scripting language and write a nice logic block that does exactly what you described in your post.
|Apr 19, 2003, 04:02 PM||#3|
Oct 2011: check out my band's first album @ boxsetauthentic.com
|Apr 19, 2003, 04:16 PM||#5|
There are many freely available analysis tools which you can set up as a cron job to scan your log directory daily, and create html output.
Most of these also handle .gz logs regardless of naming convention by scanning the folder in question.
But then again, whereas Apple is being run by a brilliant marketer with the uncanny ability to bend people to his will, Gateway is being run by a man perfectly willing to go on television and show the world that he solicits business advice from a talking cow...
|Thread Tools||Search this Thread|
|thread||Thread Starter||Forum||Replies||Last Post|
|Unix ARD command to restart on another partition||ninjaconsultant||OS X||0||Aug 8, 2011 09:04 PM|
|Mac os X finder copy to a NTFS server changes to file type to Unix||DanielSosMac||OS X||3||Aug 1, 2011 10:07 AM|
|Calling all .PST & Outlook Gurus||cmcbridejr||Windows, Linux & Others on the Mac||6||Feb 26, 2009 08:12 AM|
|Calling all musicians!||jermsmingy||Mac Help/Tips||5||Apr 30, 2002 04:45 PM|
All times are GMT -5. The time now is 01:36 AM.