bash – 查找超过1小时的-mtime文件

我有这个命令,我目前每24小时运行。
find /var/www/html/audio -daystart -maxdepth 1 -mtime +1 -type f -name "*.mp3" -exec rm -f {} \;

我想每1小时运行一次,删除1小时以上的文件。它是否正确:

find /var/www/html/audio -daystart -maxdepth 1 -mtime **+0.04** -type f -name "*.mp3" -exec rm -f {} \;

我不确定我使用的十进制数吗?

感谢您的任何更正。

编辑

或者我可以只使用-mmin 60?它是否正确?

EDIT2

我试过你的测试,好东西你建议它。我得到一个空结果。我想要删除所有文件超过60分钟!我如何做到这一点?我的命令实际上是这样吗?

-mmin怎么样?
find /var/www/html/audio -daystart -maxdepth 1 -mmin +59 -type f -name "*.mp3" \
    -exec rm -f {} \;

从男人找:

-mmin n
        File's data was last modified n minutes ago.

此外,请务必先测试一下!

... -exec echo rm -f '{}' \;
          ^^^^ Add the 'echo' so you just see the commands that are going to get
               run instead of actual trying them first.

相关文章

用的openwrt路由器,家里宽带申请了动态公网ip,为了方便把2...
#!/bin/bashcommand1&command2&wait从Shell脚本并行...
1.先查出MAMP下面集成的PHP版本cd/Applications/MAMP/bin/ph...
1、先输入locale-a,查看一下现在已安装的语言2、若不存在如...
BashPerlTclsyntaxdiff1.进制数表示Languagebinaryoctalhexa...
正常安装了k8s后,使用kubect工具后接的命令不能直接tab补全...