Automatic Images Folder Cleaning

4 views
Skip to first unread message

Phil

unread,
Aug 1, 2009, 1:23:36 PM8/1/09
to In-Portal Development
Hello guys,

In-Portal stores images in 3 types : online, pending and resized ones.

For many reasons, some pending images are not deleted by In-portal
(one of my customers has 8213 pending images using 483Mo), and some
online images aren't removed when the product is deleted from catalog.

These non-deleted images lead to bigger folder size, increasing the
backup sizes unnecessarily and creating confusion for users, which
have images with "_a" at the end of the name, whereas apparently no
product has the same image name (because an image from an old product
still exists in image folder).

I suggest to write a short script achieving the following functions:

- cleaning pending folder once a day when nobody is editing a
product

- comparing images table and images in folder, if an image isn't
listed in DB, delete it from folder

This is a small improvement, but this way In-Portal manages really all
files and keeps installation in a good state anytime.

Please let me know your thinking about this.

Phil.

Dmitry A.

unread,
Aug 1, 2009, 5:54:44 PM8/1/09
to In-Portal Development
Hello Phil,


Yes, this sounds like a good idea and would be good to have.

One of the ways we can do this via Agents and disable in default
installation.

At some point we should start highly recommend usage of Cron setup for
In-Portal users

Alex what you think on this?


Thanks.

Alexander Obuhovich

unread,
Aug 3, 2009, 4:16:37 AM8/3/09
to in-por...@googlegroups.com
Sounds like a must have script. You can attach it to your next post and I'll
try to create an agent, that will call it as Dima suggested. I also propose
to delete all images from "/system/images/resized" (former
"/kernel/images/resized") and "/system/images/pending/resized" (former
"/kernel/images/pending/resized") folders completely from time to time (once
a week or can be configured based on how often images are changed), because
they will be recreated anyway, when someone accesses product/link that uses
them.

Also any other ideas about how to improve In-Portal will be greatly
appreciated.

Dmitry A.

unread,
Aug 3, 2009, 6:07:04 PM8/3/09
to In-Portal Development
This has been converted to task In-Portal Tracker --
http://tracker.in-portal.org/view.php?id=171


Cheers!

Dmitry A.

unread,
Aug 4, 2009, 5:24:07 PM8/4/09
to In-Portal Development
This has been implemented in In-Portal 5.0.1 and will be available in
Beta shortly next week.

For those of you who is eager to test it before next week - can do SVN
checkout from http://source.in-portal.net


Cheers!

On Aug 3, 5:07 pm, "Dmitry A." <dandre...@gmail.com> wrote:
> This has been converted to task In-Portal Tracker --http://tracker.in-portal.org/view.php?id=171

Phil

unread,
Aug 5, 2009, 8:10:23 AM8/5/09
to In-Portal Development
Hi mates,

it's could be really usefull to create an agent to remove "incomplete"
orders older than xx days. The same should be used for Visitors, and
even disabling visitors tracking could be fine, as 99% of my customers
are using Google analytics.

On e-commerce website with many visits, these incomplete orders and
very old visits represent hundred thousand of unused entries in table,
which slow DB requests and make DB backup really bigger for nothing.

Thank you to consider it.

Phil.

Dmitry

unread,
Aug 5, 2009, 11:09:58 AM8/5/09
to in-por...@googlegroups.com
Hello Phil,


This issue with duplicated Incomplete Orders has been fixed in 5.0.1 and will be available in Beta to review. No need to have separate Agent for that.


Thanks.


-- 


--
Best Regards,

Dmitry V. Andrejev
> wrote:
> > Hello guys,
>
> > In-Portal stores images in 3 types : online, pending and resized ones.
>
> > For many reasons, some pending images are not deleted by In-portal
> > (one of my customers has 8213 pending images using 483Mo), and some
> > online images aren't removed when the product is deleted from catalog.
>
> > These non-deleted images lead to bigger folder size, increasing the
> > backup sizes unnecessarily and creating confusion for users, which
> > have images with "_a" at the end of the name, whereas apparently no
> > product has the same image name (because an image from an old product
> > still exists in image folder).
>
> > I suggest to write a short script achieving the following functions:
>
> >    - cleaning pending folder once a day when nobody is editing a
> > product
>
> >    - comparing images table and images in folder, if an image isn't
> > listed in DB, delete it from folder
>
> > This is a small improvement, but this way In-Portal manages really all
> > files and keeps installation in a good state anytime.
>
> > Please let me know your thinking about this.
>
> > Phil.

&#0;

Alexander Obuhovich

unread,
Aug 5, 2009, 11:12:25 AM8/5/09
to in-por...@googlegroups.com
Hi,

Related to incomplete orders in 5.0.1 version we have changed logic of how
it works and now incomplete order is created only when user adds product to
cart and not each time user visits a site. This should help for cases, when
google or other search bot indexes whole product catalog creating a lot of
incomplete orders.

As an option during upgrade to in-commerce 5.0.1 we can intellectually
guess, what of incomplete orders were not created by humans and to delete
them. Dima what's your opinion about this. If possible, then please provide
Orders and OrderItems tables from live site, where are data samples of how
exactly google created orders looks like.

Related to option to turn visits off I aggree, it's useful option, what you
think Dima?

Cheers.

Dmitry

unread,
Aug 5, 2009, 11:45:15 AM8/5/09
to in-por...@googlegroups.com
1. Yes, I agree that Visitor Tracking can be disabled by default. I have noticed that Visits table grows pretty fast on some site adding unnecessary load on DB.

Will be added in 5.1.0 -- http://tracker.in-portal.org/view.php?id=186



2. Yes - we'll add up a script to the 5.0.1 upgrade that will clean up ALL Incomplete Orders!

http://tracker.in-portal.org/view.php?id=187



Cheers!



-- 


--
Best Regards,

Dmitry V. Andrejev


-----Original Message-----
> wrote:
> > Hello guys,
>
> > In-Portal stores images in 3 types : online, pending and resized ones.
>
> > For many reasons, some pending images are not deleted by In-portal
> > (one of my customers has 8213 pending images using 483Mo), and some
> > online images aren't removed when the product is deleted from catalog.
>
> > These non-deleted images lead to bigger folder size, increasing the
> > backup sizes unnecessarily and creating confusion for users, which
> > have images with "_a" at the end of the name, whereas apparently no
> > product has the same image name (because an image from an old product
> > still exists in image folder).
>
> > I suggest to write a short script achieving the following functions:
>
> >    - cleaning pending folder once a day when nobody is editing a
> > product
>
> >    - comparing images table and images in folder, if an image isn't
> > listed in DB, delete it from folder
>
> > This is a small improvement, but this way In-Portal manages really all
> > files and keeps installation in a good state anytime.
>
> > Please let me know your thinking about this.
>
> > Phil.



a
Reply all
Reply to author
Forward
0 new messages