Urchin Stopped Reporting Statistics

Earlier today, one of our hosting customers notified me that there Urchin stats stopped reporting traffic around the beginning of May. Of course my first questions was “why did you wait until now to tell me?” After which I started Googling the problem. I found the solution regarding How do I recover from ‘Unable to open database for writing since it has been archived’ error?.

I am not big on deleting files as suggested in that solution so I did a little more digging. Shortly thereafter I found Urchin 5 Stats Stopping over at TheOneAndTheOnly.com. I liked this solution much better and figured I would take it one step further.

I though about writing a shell script and posting the source here, but we track so few with Urchin, that it was not worth the time. So I just kept notepad open with all my commands to copy & paste commands for the few domains we needed to fix. Here is the code I used…

cd /usr/local/urchin/data/reports/yourdomain.com/
unzip "*-archive.zip"
mkdir archive-backup
mv *-archive.zip archive-backup
cd ../

I had to wrap to wrap the wildcard filename (line 2) in quotes to make it work for our configuration for some reason. These commands could easily be transfered into a shell script though. All you would need to do is loop through each folder located in the Urchin reports folder (/usr/local/urchin/data/reports/*/) and run the commands on each directory. If I decide to write the code for it, it will be added here at that time.

I hope this helps someone else.

Leave a Reply

Your email address will not be published. Required fields are marked *