I have a folder with large files in centos and how to delete the files older than 30 minutes.
Please suggest your ideas and snippets
I have a folder with large files in centos and how to delete the files older than 30 minutes.
Please suggest your ideas and snippets
It's simple. just use find
and add the following line incrontab
:
30 * * * * find /path/to/dir -type f -mmin +30 -exec rm -f {} \;
the above command will run every 30 minutes and delete ONLY files older that 30 minutes from the directory /path/to/dir