Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
find files within two timestamps on any day
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
njcwotx
Guru
Guru


Joined: 25 Feb 2005
Posts: 564
Location: Texas

PostPosted: Mon Dec 30, 2013 10:28 pm    Post subject: find files within two timestamps on any day Reply with quote

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
View user's profile Send private message
njcwotx
Guru
Guru


Joined: 25 Feb 2005
Posts: 564
Location: Texas

PostPosted: Mon Dec 30, 2013 10:51 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum