Answer the question
In order to leave comments, you need to log in
Can you recommend a script to search for extra files on the hosting?
There is a site made on php+mysql(without cms). with a life history of about 7 years. During this time, more than 20,000 pictures have accumulated in the images folder, many of which were used in articles that are currently deleted.
Advise, pliz, a script for selecting and deleting such files
Answer the question
In order to leave comments, you need to log in
Do you want a ready-made one for your site? :)
Pull out a list of pictures, then search through directories and filter.
form a list of the necessary pictures (for sure there is somewhere in mysql), then form a list of files in the directory ( ls > list.txt
), subtract the first from the second - get a list of files to delete.
well, then - bash in hand and cycle through the file with the list to delete and .... drum roll .... delete.
Pulling out a list of pictures....
Can it be stupid to demolish them by the time of the last appeal? :) Just back up first. Yes, and check that your provider generally allowed the last access time attribute.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question