View Single Post
Old 01-14-2025, 05:33 PM  
cerulean
Web & App Development
 
cerulean's Avatar
 
Industry Role:
Join Date: Oct 2023
Location: United States
Posts: 122
If I were you, I would avoid doing this in PHP (and I'm primarily a PHP developer.) PHP is certainly capable of this, but loading a programming language runtime just to run existing system commands does complicate the process.

If you're on Linux, you can use the find command and your host should be well-versed in how to do this anyway:

https://stackoverflow.com/a/69374901

If you're on Windows, similar things exist:

https://stackoverflow.com/a/51069

Either way, you should make backups of these files before deleting them, and you should capture the output of whatever you run, and send a notification on success. That way you know when it runs, and whether it's successful.
__________________
Cerulean Software Specializes in Website and App Development. Email me today!

Keep Your Business and Members Area Secure with LoginBlue Password and Content Protection
cerulean is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote