count of file

Hi ,

I have a directory where i recive file at every 3-5 min throughout the days. I want to count number of files come per hour and per day.

i want to count number of record in the file for whole day.

How can i achive .

Regards

Rajesh

Create a script with the required stuffs and run the script every hour?

I think you have not understood the requirment, this is not the regular task, this can be executed at 15 day or 1 month time during audit. i don't know how to count all the file in last one hour or in a day. i don't know how to group by time to get number of file in an hour. i want to count the number of file let say between 10-11, 11-12, or today's date

You could start with something like:

ls -l directory_path | grep "Jul 17 12" | wc -l

This would get you the number of files for 12:00 to 12:59 on July 17 (depending on your ls implementation - you may need to tweak the search expression).

(note: you didn't specify how old the files would be - for files which are more than afew months old you won't get a time from ls).