View Single Post
Old 01-18-2025, 09:56 PM  
Killswitch
👏 REVOLUTIONARY 👏
 
Killswitch's Avatar
 
Industry Role:
Join Date: Oct 2012
Posts: 2,304
Quote:
Originally Posted by natkejs View Post
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 {} \;
You're assuming this person is comfortable and familiar with the command line and the find command.

My assumptions are they know how to write PHP but that's about it.

And if you're optimizing your cronjobs there's a root issue not being solved.
__________________
Killswitch is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote