1

This command runs fine

find /eqtynas/ -type f -mtime -1 -print0 | du -ch --files0-from=- --total -s > /tmp/24hourUsage.20171101 &

however it takes in a 24 hour block of time since I run the command. So if I run this at 7pm, I get a lot of files from the previous work day starting at 7pm.

I tried the -daystart command which I am having difficulty integrating it with the pipe to disk usage. For some reason, -daystart is sucking in files from the previous day (before midnight).

Would there be a way to extract just the files created from 7am to 5pm (a ten hour time frame) with Linux find command?

U880D
  • 597
  • 7
  • 17
capser
  • 111
  • 1
  • when I use find . -type f -newermt "today 7:00:00" ! -newermt "today 17:00:00" I get find: invalid predicate `-newermt' – capser Nov 02 '17 at 02:06
  • 1
    `find . -type f -newermt "today 7:00:00" ! -newermt "today 17:00:00"` worked for me. can you check which find version you have? Your version probably does not support newermt. – Tux_DEV_NULL Nov 02 '17 at 08:00
  • There are some threads on Unix Stackexchange regarding `-newermt` under [What does newermt mean in find command?](https://unix.stackexchange.com/questions/169798/what-does-newermt-mean-in-find-command) or [Find files newer than 15 seconds but older than 2 seconds](https://unix.stackexchange.com/questions/238738/find-files-newer-than-15-seconds-but-older-than-2-seconds), as well here on Serverfault under [Linux: using find to locate files older than ](https://serverfault.com/questions/122824/linux-using-find-to-locate-files-older-than-date). – U880D Jul 17 '18 at 09:39

0 Answers0