Quote:
Originally Posted by Killswitch
For the record, the overhead of executing PHP to run file commands like unlink while is overhead, it's negligible and you shouldn't complicate things for yourself because someone else's preferences.
|
It's not about the overhead of running unlink, it's about the directory listing which is exponentially faster using find.
Since the PHP script does nothing that a simple find command can't do, the cron should simply run the find command not a PHP script.
Something like:
find /path/1/ /path/2/ /path/3 -type f -mtime +30 -exec rm -f {} \;