I have a filed in my database that logs an expiry time for files. When that expiry time is reached the colum safe_to_delet is set to 1.
I have a PHP script that I wrote to pull all records from the database whose safe_to_delete = 1 and then remove the files from the server, but not the record from the db. Instead, if the deletion is successful, is_deleted is updated to 1.
Is this the best way to do this? It seems to be inconsistent as some files that are past their expiry time are still there. I can post the code later but want to know if I'm on the right track.
TIA