Results 1 to 8 of 8
  1. #1
    Join Date
    Oct 2012
    Posts
    25
    Plugin Contributions
    0

    Default How to purge bmz cache folders automatically?

    I use shared hosting and my host puts a limit on the number of files/folders per directory at 1024. If I go over am in violation of their Service Agreement and face possible suspension. The problem is that a plugin I use with my Zen Cart site caches files in a bunch of directories and due to the large number of product images/categories in my cart will eventually exceed 1024 files per directory unless I regularly clean out or delete the cache folders.

    I would like to set something up that takes care of this for me automatically. Want to know if I can have all the files in particular folders automatically purged when the number of files per folder reaches 1000, and if so how would I go about it.

    If that is not possible (or practical for a newbie to do on their own) would like to know how to set up something that will either delete all the files in each folder on a bi-weekly/monthly basis, or just delete the folders entirely. I assume I would use the Cron Job Manager in my host's Control Panel for this but have never used it before, would like to know what the command I would use would look like.

    Have been told that answer is to simply switch to a host that does not limit the number of files allowed in a directory. I agree with that but am looking for a solution I can use now.

    Thanks, Ed

  2. #2
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,761
    Plugin Contributions
    9

    Default Re: How to purge cache folders automatically?

    Disable the url rewriter that is the cause of the cache files
    Zen-Venom Get Bitten

  3. #3
    Join Date
    Jan 2004
    Location
    N of San Antonio TX
    Posts
    9,103
    Plugin Contributions
    11

    Default Re: How to purge cache folders automatically?

    What happens if you have 1025 products! Another fully-unqualified e-commerce heard from I'm afraid.

  4. #4
    Join Date
    Sep 2005
    Location
    Waikato, New Zealand
    Posts
    1,539
    Plugin Contributions
    3

    Default Re: How to purge cache folders automatically?

    Ed, tell us what the plugin is.

    If its a URL rewriter I can't help you, but if its something like image handler, i may be able to help.

    although it may take a little while before I can dig out my old code
    Last edited by nigelt74; 1 Jan 2013 at 01:58 AM.
    Webzings Design
    Semi retired from Web Design

  5. #5
    Join Date
    Oct 2012
    Posts
    25
    Plugin Contributions
    0

    Default Re: How to purge cache folders automatically?

    The plugin is Image Handler 4 (for v1.5.x). Seems to be working fine- the issue is with my host. I have leads on other good hosts that don't have these restrictions and will be switching when time comes, but need a solution for now. My web searches come up with a cron job that looks similar to this:

    rm -rf /MYCART/bmz_cache/*

    or maybe this:

    'rm' -rf /MYCART/bmz_cache/*

    But am thinking probably have to put the absolute path into the command, maybe something like this:

    'rm' -rf /home/content/XX/XXXXXX/html/MYCART/bmz_cache/*

    From what I can tell this will delete all the cache folders which will be restored when needed by IH4. Would prefer to wait until each folder was close to it's limit of 1024 then have them purged but looks to be a much more involved job.

    Any advice/corrections are appreciated.

  6. #6
    Join Date
    Sep 2005
    Location
    Waikato, New Zealand
    Posts
    1,539
    Plugin Contributions
    3

    Default Re: How to purge cache folders automatically?

    You could try this

    It wont stop the folders going over 1024 files, but it should lessen the likelihood considerably

    Instead of splitting the optimised images between 16 folder it splits them between 256 subfolders
    Webzings Design
    Semi retired from Web Design

  7. #7
    Join Date
    Oct 2012
    Posts
    25
    Plugin Contributions
    0

    Default Re: How to purge cache folders automatically?

    Thanks Nigel, that looks like the ideal solution. Will do the code change and post results in the Image Handler 4 thread.

  8. #8
    Join Date
    Sep 2005
    Location
    Waikato, New Zealand
    Posts
    1,539
    Plugin Contributions
    3

    Default Re: How to purge cache folders automatically?

    Instead of that, reply to this thread

    so as to stop the IH thread getting off topic with unsupported mods
    Webzings Design
    Semi retired from Web Design

 

 

Similar Threads

  1. v139h BMZ Cache
    By jgold723 in forum General Questions
    Replies: 3
    Last Post: 11 Aug 2014, 04:30 PM
  2. v139h bmz cache and image code generation
    By shags38 in forum General Questions
    Replies: 2
    Last Post: 5 Sep 2013, 12:41 AM
  3. v139h BMZ Cache and optimizing images
    By jgold723 in forum General Questions
    Replies: 1
    Last Post: 4 Sep 2013, 06:54 PM
  4. v151 Image Handler - Extra BMZ folders for GoDaddy (and other cheapie hosts) users mod.
    By nigelt74 in forum All Other Contributions/Addons
    Replies: 11
    Last Post: 21 Jul 2013, 07:54 PM
  5. Bmz Cache - Image Handler
    By harry2cool in forum All Other Contributions/Addons
    Replies: 3
    Last Post: 30 Sep 2010, 07:45 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR