cache remove script doesn't run with Cron Job

mjhassanli

New member
Joined
Apr 30, 2020
Messages
1
I need to remove files in the cache directory every specific hours of day.
I create a PHP, when I open this file anywhere in my browser It's possible, but I need something like cron job to run that script periodically every some hour.

This is my PHP file (remove-cache.php):
PHP:
<?php $files = glob('application/cache/*'); foreach($files as $file){ if(is_file($file)) unlink($file); } ?>

I used this command line in cron job: (not worked!)
Code:
/usr/local/bin/php /home/vitriini/domains/{myDomain}/public_html/remove-cache.php
but it has not been worked.

please help me to fix this cron job
 
Back
Top