B
B
burabay862015-12-09 20:28:55
PHP
burabay86, 2015-12-09 20:28:55

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

4 answer(s)
R
romy4, 2015-12-09
@romy4

Do you want a ready-made one for your site? :)
Pull out a list of pictures, then search through directories and filter.

M
Max, 2015-12-09
@MaxDukov

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.

B
burabay86, 2015-12-09
@burabay86

Pulling out a list of pictures....

I would like some hints on how to get the list of used files from the images folder from the tables of the mysql database without delving into the "thinking along the tree" of the creator of this wonderful site (there are also miracles with file extensions)

A
Anton Chernousov, 2015-12-09
@tech22

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 question

Ask a Question

731 491 924 answers to any question