Hi,
My customer is running a ftp-server with about 6.000 accounts. we need
to log all activities concerning the ftp-server. uploads, downloads,
virus occurences etc.... there are about 10.000 new entries in the
database each day.
they will be used for statistics.
each day my customer will get an email with some points:
Total logins/unique users
Total uploads
MB transfered
found viruses
....
So I think it's useful to use a database to store alle the information
and run the statistic-queries.
Yes, I see your application better now.
My knowledge about databases is very poor.
Any other suggestions?
Yes, I surely hope that you get some other opinions than mine!
I was not sure how to handle this with ruby/ror because I'am (I was!!!)
a php man and it's the first project I want to do with ruby.
These are my first lines od ruby code - and I want to make it good.
So, seeing you're a php coder, and not used to ruby, I will try again.
You first have to chose between 2 options, do you want a real framwework
like Ruby on Rails, Nitro, IOWA or something similar, or stay with the
approach from php (erb/eruby/erubis).
My approach would best work within a framework (Og is in fact part of
Nitro).
I researched a bit and coded a little. As it's just scrap code and
it's a bit longish, I put it into a paste service. Feel free to copy
small parts here if something is unclear.
## get data from pure-uploadscript
http://pastie.caboo.se/27389
When called like `UploadedFile.parse_pure_uploadscript` it returns a
UploadedFile instance with your data.
## setting up the database
http://pastie.caboo.se/27391
This configures Og and creates a table to save your data. It can be
extended by adding more `propery :symbol, Type` entries.
## setting up the clamav 'parser'
http://pastie.caboo.se/27393
I extended the original a bit, allowing for a local clamavscan.
## Putting the parts together
http://pastie.caboo.se/27394
This, when run, expects the filename as the first argument, uses
the uploaded_file 'parser' to get all the data from the environment,
feeds that to the clamav scanner and saves the result by using Og.
Must be a bit confusing for a newcomer, it's not all 'newbie' code,
but I hope that helps you a little to see how this _could_ be done.
Anyway, maybe somebody else can jump in and propose another solution.
(What I didn't get into here, is on how to present the data. Sorry.
Tell me which road you want to go (framework or plain erb/eruby),
and I'll try to write something up for that.)
I apologize to everyone who sees this message in the future when the
pastie links are all dead.... just send me an email and I'll try to
dig it up again.
Enjoy