Bash 如何使用Cron作业查找和删除15天以前的文件?

Bash 如何使用Cron作业查找和删除15天以前的文件?,bash,shell,bin,Bash,Shell,Bin,我想删除文件,这些文件已超过15天。文件目录是 /home/app_admin/files “文件”目录中有100多个文件夹,我只想删除超过15天的文件,而不删除文件夹 在“文件”目录中,有许多文件夹,如下所示↓↓↓ 16 Jwellary Image Clipping 300 photos to be retouched Ashraf Amin Background removal Background removal and retouching Brad C Change wording

我想删除文件,这些文件已超过15天。文件目录是

/home/app_admin/files
文件”目录中有100多个文件夹,我只想删除超过15天的文件,而不删除文件夹

在“文件”目录中,有许多文件夹,如下所示↓↓↓

16 Jwellary Image Clipping
300 photos to be retouched
Ashraf Amin
Background removal
Background removal and retouching
Brad C
Change wording in a Photoshop file
Color Correct 123 Product Photos
cut out some high res photos
我想删除此文件夹中的文件


有人能帮我弄清楚这一点吗。

首先检查要删除的内容:

find path/to/basedir -mtime +15 -type f
如果输出看起来不错,则添加
-删除

find path/to/basedir -mtime +15 -type f -delete

你试过什么?类似的任务已经在这个网站上解决了好几次…你看过吗?有些轮子不需要重新发明。