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

sknake commented: duplicate posts -1

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.

Go back further.

Explain, exactly, what it is you are trying to do, with all factors detailed.

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".

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

Closing this thread as there is another thread by same user running here.
In the future please do not double post.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.