Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

My company hosts an open source RPM repository and would like to start counting RPM downloads per day. The repository is hosted on Apache httpd. Can anyone recommend a good way to count the downloads of just the RPM files (which will have URLs of the form http://packages.mycompany.com/packages/continuous/trunk/fedora/10/RPMS/package1.rpm) while excluding any other accesses to the repository URLs for index browsing, etc. ?

share|improve this question

2 Answers 2

up vote 1 down vote accepted

If you don't want to go with classic apache log analyzers like awstats or webalizer, you might want to try visitors, a simple CLI log file analyzer.

visitors -o text ACCESS.LOG | grep " /" | grep ".rpm"

will give you a list of requested RPMs sorted by popularity with the number of downloads included after the file name. Non-RPM downloads will be ignored, so the order might look a little funny.

1)    /rpm/example.rpm: 4
3)    /rpm/example2.rpm: 2

for example.

share|improve this answer

The simplest answer would be something along these lines:

grep ".rpm" /var/log/httpd/access_log | wc -l

This would give you the number of files accessed with .rpm in their name. Simple I know, but effective.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.