The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Delete unused/inactive images

Discussion in 'General Discussion' started by Olle Dahlquist, Aug 15, 2016.

  1. Olle Dahlquist

    Olle Dahlquist Registered

    Joined:
    Aug 15, 2016
    Messages:
    4
    Likes Received:
    1
    Trophy Points:
    3
    Location:
    Boden, Sweden
    cPanel Access Level:
    Website Owner
    Hello,

    My name is Olle Dahlquist and I live in Boden/Sweden - 100 miles south of the Arctic circle.
    Yes, we still have summer and no ice bears on the streets.
    My profession is graphic and web designer since 1994.

    My problem is that I have forced to take over a web site made with MySQL, CPanel and WHM.
    This is new to me and I have managed to do some changes.
    Now I see that the images in the Upload-folder takes 130 MB of the 250 MB that is provided by the host. In all 245 MB is used by images and e-mail.
    Now I am looking for a plug-in that can delete all unused and/or inactive images.
    As I look in the sub folders I see all kind of versions of the same images, and I don't know which one to delete.

    All help is appreciated and I am sorry if this is a to simple question for you experienced users.

    Kind regards,

    /Olle Dahlquist
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello @Olle Dahlquist,

    Welcome to the cPanel Forums!

    You may find it difficult to sort those files by activity or creation date if you do not have SSH access enabled on the account. You would have to use the File Manager option in cPanel or a FTP client such as FileZilla to manually view and delete the images in that directory. If you do have SSH access, or if your hosting provider will run the command for you, you can recursively list all files in a directory and sort by creation date with a command such as:

    Code:
    find /home/example/public_html -printf '%T@ %c %p\n' | sort -k 1n,1 -k 7 | cut -d' ' -f2-
    Simply replace "/home/example/public_html" in this command with the path to the directory you want to list files from.

    Thank you.
     
  3. Olle Dahlquist

    Olle Dahlquist Registered

    Joined:
    Aug 15, 2016
    Messages:
    4
    Likes Received:
    1
    Trophy Points:
    3
    Location:
    Boden, Sweden
    cPanel Access Level:
    Website Owner
    Thanks!

    But, my problem is that the upload directories contain dozens of duplicate images. At least they look the same, but are of different versions. I have no clue which image is used, and which is not.
    I have downloaded the entire site and can browse it, so that is not the problem.
    As I have browsed the net; I thought that there was some plug-in available like there is for WordPress to delete inactive/unused images.
    I also guessed that the web site was built with WP, as some directories are named WP-Admin, WP-Content etc.

    There are only 1359 files to check... and I guess the solution is to make a search for /uploads/ in the html-files and see what names the files got and then delete the rest. Back to the old HTML-programs...

    /Olle
     
  4. Olle Dahlquist

    Olle Dahlquist Registered

    Joined:
    Aug 15, 2016
    Messages:
    4
    Likes Received:
    1
    Trophy Points:
    3
    Location:
    Boden, Sweden
    cPanel Access Level:
    Website Owner
    Now the s**t hit the fan...

    First I made a backup of the uploads-folders.
    Then I saved the ones that were "originals". The other had extra info like img_2_1024.628,jpg.
    Then I deleted the content on the server and uploaded the original files. Result = All images vanished.

    Then I uploaded the rest of the files from my backup. Result = A few files showed up. but then some images that was missing on the webpage said: "_img2.jpg", but there are no files having the underscore (_) in the backup.

    All tranfers were made using WD_FTP PRO. Checked that all the transfered files keep large and small characters like M instead of m.

    The big problem is that the server is full (248 of 250 MB) so I am having problems deleting the non active images.
    I have checked the source code and noticed that some images have double links. One to the original and some to one of the smaller versions.

    I also noticed that files were stored in \uploads2013\05\
    The same files are also stored under \uploads\sites\3\2013\05
    and when I look the \3\05\ directory has vanished - even thought I haven't done anything in that folder.

    Mystery!! And I need help!

    /Olle
     
  5. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,478
    Likes Received:
    203
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    This is more of an issue for the wordpress support forums. Assuming you know the names of all the addons installed on the wordpress site, one of them seems to be used for manipulating the images to make different sizes, or something. Not really much to go on from your posts.

    The wordpress community would recognize the names of your wordpress addons if you post over there, and there's most likely threads on their forums related to managing the plugin and its files.

    My suggestion is you post over there for more specialized support to assist you better:
    WordPress › Support
     
  6. Olle Dahlquist

    Olle Dahlquist Registered

    Joined:
    Aug 15, 2016
    Messages:
    4
    Likes Received:
    1
    Trophy Points:
    3
    Location:
    Boden, Sweden
    cPanel Access Level:
    Website Owner
    Thank you!
    I will do that ;-)

    /Olle
     
    Infopro likes this.
Loading...

Share This Page