Hi All,
Please advise..

I need to create a script that keeps track on the number of times a file is accessed in a day.

Can we use events/triggers if any..

If a file is accessed, then event should increment the count variable.

I need to know more on events/triggers on file access.

Please help.

Thanks

Comments
duplicate posts

If this is that "download count" problem, then you are going about it completely the wrong way.

If it is "good enough" to get the count the next day, then simply parse the servers access log. If you need it "real time", then don't give direct access to the file, at all. Only allow people to "download" it through a cgi/servlet/whatever and have that directly record the attempt.

Yes, I initially decided on the same- tracking the access log of the server, but that cant be done, because its not a server but a storage device from which files are downloaded, but there is no access log.

Masijade,
Actually, I want to track the number of times a report(xls file) is downloaded from the storage device. Need to know if I can write a script for the same.
There is no access log for storage device, hence cannot make use of it.

Second suggestion "don't give direct access to the file" cannot be considered.
Need to do this with existing functionality only, not allowed to enhance the existing system.

Thanks in advance...

Then you're tough out of luck. If you poll the file with ls -u (on solaris) every few milliseconds you can get a rough (and I do mean rough) estimate, at an extreme overhead cost, but that's all.

Edit: And, BTW, that is not a "download". A "download" runs through a server of some type. If the "clients" have direct access to the file directly through the file system, it is not a "download".

Edited 7 Years Ago by masijade: n/a

Ya, even I wasnt sure that its a download or not. Hence, I was stressing that I want to track access time of files.

Thanks a lot for your responses..

Please advise if you can help further

This article has been dead for over six months. Start a new discussion instead.