Delete files in the cron php folder

You need to clean the specified folder of files every 6 hours. I can't find a solution anywhere. Before that, I did not work with the crown

 0
Author: Reynold, 2017-06-05

3 answers

Shell command to delete files in a directory (if there are no nested directories in that directory):

rm /путь/к/каталогу/*

This command should be executed by specifying its frequency. i.e., for "once every six hours", the line in the file crontab should look something like this:

0 */6 * * * rm /путь/к/каталогу/*

I.e., in 0 minutes every six hours (second field - */6) every day of the month (third field - *) every month (fourth field - *) regardless of the day of the week (fifth field - *) execute the command rm ... (last, sixth field).

 2
Author: aleksandr barakin, 2017-06-05 19:33:42
find $LOCATION -name $REQUIRED_FILES -type f -mmin +360 -delete

Where +360 number of minutes (360 minutes == 6 hours)

 0
Author: ishidex2, 2017-06-05 18:47:14
find /путь к каталогу/ -type f -mmin +360 -delete

The script for deleting files older than 360 minutes regularly runs the settings during the creation of the crown, if you are in ispmgr

 0
Author: allaurross, 2018-08-07 14:24:07