osCommerce and osCMax shopping cart software forums

Shopping Cart Software

osCommerce with teeth!

 

Remove Unused Images

This is a discussion on Remove Unused Images within the New osCommerce Contributions forums, part of the osCommerce 2.2 Forums category; Scenario: I have 9000 image files. 2400 of them are not being used. How to find them and remove them ...



Find us on Facebook
Go Back   osCommerce and osCMax shopping cart software forums > osCommerce 2.2 Forums > New osCommerce Contributions

Connect with Facebook Register FAQDonate Members List Calendar Mark Forums Read


Reply

 

LinkBack Thread Tools
  #1  
Old 11-06-2008, 05:11 PM
michael_s's Avatar
osCMax Developer


 
Join Date: Jul 2002
Location: Phoenix, AZ
Posts: 15,758
Thanks: 139
Thanked 609 Times in 521 Posts
Rep Power: 10
michael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond repute
Post Remove Unused Images

Scenario: I have 9000 image files. 2400 of them are not being used.
How to find them and remove them quickly and safely

What this script does:
* Read the database and report back a list of installed images
* Mark (in RED) any DB listed image which does not exist on the server
* Read the server images and report back a list
* Compare the lists for missing data
* Offer you the ability to check or uncheck listed images controlling what gets renamed
* Rename the USER checked listed images from myimage.jpg to UNUSED_myimage.jpg
* Allow you to ftp and delete ALL renamed UNUSED_myimage.jpg images

More...
__________________
Michael Sasek
osCMax Developer

*** Do not PM me requesting paid help. The only paid work I do is for AABox Web Hosting customers ***

Stay Up To Date with everything osCMax:
Free osCMax Newsletters - Security notices, New Releases, osCMax News
osCMax on Twitter - Up to the minute info as it happens. Know it first.

osCMax User Manual - osCMax Templates - Advanced Template Tutorial

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2  
Old 05-11-2009, 05:29 AM
New Member
 
Join Date: May 2007
Posts: 12
Thanks: 7
Thanked 0 Times in 0 Posts
Rep Power: 0
nickt15 is on a distinguished road
Default Re: Remove Unused Images

If I delete a product does it delete the image associated with that product ?

Also looking at my images directory not all the images arte stored there, what other directories hold images ?
Thanks
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3  
Old 05-11-2009, 09:08 AM
michael_s's Avatar
osCMax Developer


 
Join Date: Jul 2002
Location: Phoenix, AZ
Posts: 15,758
Thanks: 139
Thanked 609 Times in 521 Posts
Rep Power: 10
michael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond repute
Default Re: Remove Unused Images

1. No. It does not do that (delete images when you delete products).

2. That is where images are stored by default (/images). If you are storing images elsewhere, you should know where that is, since you had to customize the settings to get osCommerce to store them in other locations.
__________________
Michael Sasek
osCMax Developer

*** Do not PM me requesting paid help. The only paid work I do is for AABox Web Hosting customers ***

Stay Up To Date with everything osCMax:
Free osCMax Newsletters - Security notices, New Releases, osCMax News
osCMax on Twitter - Up to the minute info as it happens. Know it first.

osCMax User Manual - osCMax Templates - Advanced Template Tutorial

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4  
Old 05-11-2009, 10:45 AM
New Member
 
Join Date: May 2007
Posts: 12
Thanks: 7
Thanked 0 Times in 0 Posts
Rep Power: 0
nickt15 is on a distinguished road
Default Re: Remove Unused Images

Someone else setup the site, any way to determine how to find the other image directories ?
Your company hosts the sites so can you guys figure where ?
Thanks
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5  
Old 05-11-2009, 02:21 PM
michael_s's Avatar
osCMax Developer


 
Join Date: Jul 2002
Location: Phoenix, AZ
Posts: 15,758
Thanks: 139
Thanked 609 Times in 521 Posts
Rep Power: 10
michael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond repute
Default Re: Remove Unused Images

You could use several methods to find images. You can use the Cpanel Disk Usage utility that shows what files and where. Login to your cpanel account to use this.

You could use a command line search via ssh:

Code:
find . -type f -name "*.jpg" | xargs ls -l

find . -type f -name "*.gif" | xargs ls -l
Those will ouput all image and their paths for you, so you can see where every image is on your account.
__________________
Michael Sasek
osCMax Developer

*** Do not PM me requesting paid help. The only paid work I do is for AABox Web Hosting customers ***

Stay Up To Date with everything osCMax:
Free osCMax Newsletters - Security notices, New Releases, osCMax News
osCMax on Twitter - Up to the minute info as it happens. Know it first.

osCMax User Manual - osCMax Templates - Advanced Template Tutorial

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
The Following User Says Thank You to michael_s For This Useful Post:
nickt15 (05-27-2009)
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads

Thread Thread Starter Forum Replies Last Post
How To Remove Other Images For This Product Box? m82492 osCommerce 2.2 Modification Help 2 09-23-2008 02:10 PM
Remove Default Images michael_s New osCommerce Contributions 0 06-04-2007 07:14 AM
Add/Remove images from "New Products" Mats_H osCommerce 2.2 Modification Help 2 05-06-2006 09:11 AM
Remove "add to cart" function from images in produ adam71o osCMax v2 Customization/Mods 2 01-26-2006 04:48 PM
Remove Product Images from server chitta_rn osCMax v2 Customization/Mods 1 12-25-2005 09:56 AM


All times are GMT -8. The time now is 01:02 AM.


Powered by vBulletin®
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
SEO by vBSEO
Copyright 2009 osCMax
Inactive Reminders By Icora Web Design