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:
referrer_log.1050192000.gz
referrer_log.1050364800.gz
referrer_log.1050451200.gz
referrer_log.1050537600.gz
referrer_log.1050624000.gz
referrer_log.1050710400
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...
referrer_log.1050192000.gz
referrer_log.1050364800.gz
referrer_log.1050451200.gz
referrer_log.1050537600.gz
referrer_log.1050624000.gz
referrer_log.1050710400
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...