I am trying to write something that runs in the background under linux (ubuntu server). I need a service of some sort that deletes files that are older than 2 days from the files system (own cloud storage folder).
我正在尝试编写在linux下运行的东西(ubuntu服务器)。我需要某种服务,从文件系统(自己的云存储文件夹)中删除超过2天的文件。
What is the best way to approach this?
解决这个问题的最佳方法是什么?
1 个解决方案
#1
Use find
find topdir -type f -mtime +2 -exec rm {} +
Use cron
to run it periodically.
使用cron定期运行它。
#1
Use find
find topdir -type f -mtime +2 -exec rm {} +
Use cron
to run it periodically.
使用cron定期运行它。