Eu usaria find
e especificaria -mtime
assim, por exemplo
cd /var/log/apache2
find *.log -mtime -1 -exec ls -l --time-style=iso {} \;
produziria o seguinte:
-rw-r----- 1 root adm 440 09-10 20:00 error.log
-rw-r----- 1 root adm 3944602 09-11 02:08 other_vhosts_access.log
se eu quisesse copiá-los, faria o seguinte:
find *.log -mtime -1 -exec cp -v {} /tmp/ \;
produziria:
error.log' ->
/tmp/error.log'
other_vhosts_access.log' ->
/tmp/other_vhosts_access.log'
mais no mtime:
For example:
find . -mtime 0 # find files modified between now and 1 day ago
# (i.e., within the past 24 hours)
find . -mtime -1 # find files modified less than 1 day ago
# (i.e., within the past 24 hours, as before)
find . -mtime 1 # find files modified between 24 and 48 hours ago
find . -mtime +1 # find files modified more than 48 hours ago
find . -mmin +5 -mmin -10 # find files modified between
# 6 and 9 minutes ago
fonte: link