View previous topic :: View next topic |
Author |
Message |
njcwotx Guru
Joined: 25 Feb 2005 Posts: 587 Location: Texas
|
Posted: Mon Dec 30, 2013 10:28 pm Post subject: find files within two timestamps on any day |
|
|
I have a very large number of jpg file generated by a security camera. Over a few months time a huge number of files can get generated, so its good to pare down the files that are unneeded when I have to search through them.
Lets say I have 90 days worth of files, and I only want to find the files that were generated between 3pm and 5pm each day.
I know how use find to search based on older than x days or newer than x days and even between two dates, but now I want to filter to between 3-5 pm over 90 days. I have been using find most of the time, but I know awk and its variants have possibly better ways and I read perl had a good filter library. The only trouble is I am weak at those two so if I was to get examples from those it would have to be enough 'canned code' that I could repeat on my Gentoo almost literally with simple modifications! _________________ Drinking from the fountain of knowldege.
Sometimes sipping.
Sometimes gulping.
Always thirsting. |
|
Back to top |
|
|
njcwotx Guru
Joined: 25 Feb 2005 Posts: 587 Location: Texas
|
Posted: Mon Dec 30, 2013 10:51 pm Post subject: |
|
|
I have been using this format between two dates and times. but it treats these as start and end times.
Code: | find . -type f -newermt "2013-09-01 15:00:00" ! -newermt "2013-12-31 17:00:00" |
I tried the following but it only tests for the current day.
Code: | find . -type f -newermt "15:00:00" ! -newermt "17:00:00" |
_________________ Drinking from the fountain of knowldege.
Sometimes sipping.
Sometimes gulping.
Always thirsting. |
|
Back to top |
|
|
|