I need to find files modified in August. Here's my portion of the command that narrows down the modification time. This works, but it seems to be missing some files. I'm guessing this is missing files modified in a given hour or hour(s) because the numbers change depending on what part of the day that I run this script. I'm looking at the -mmin
parameter but am struggling with how to exactly implement it. I'm looking for all files modified between Aug 1 - 31
.
$dayOfMonth = date("j");
$daysLastMonth = date("t", strtotime('-1 month'));
$secondsSinceMidnight = time() - strtotime('00:00');
$secondsUntilMidnight = (60*60*24) - $secondsSinceMidnight;
$commandAppend = " -name '*.pdf' -mtime -".($dayOfMonth+$daysLastMonth)." -mtime +".($dayOfMonth)." | wc -l";