Maintenance

This part of the 4.x documentation is for eZ Publish 4.0, only reference section is common for all eZ Publish 4.x versions as well as eZ Publish 5.x "LegacyStack", please select the version you are using for the most up to date documentation!

When a new version of an object is created when using eZ Publish 4.2 and 4.3, the images of the first version are put into storage. But when the first version is deleted, the images are not removed completely, but remain in storage. This implies that these images are still accessible with their URL and that they have been indexed by Google. To prevent for example copyright issues, it is recommended that these images are deleted as well. Therefore it is necessary to clear expired binary items from your database cluster installations (such as eZ DB and eZ DFS). This can be done with one of two ways, either by running a script or a cronjob, depending on how regular you wish or need to delete expired images.

Use the first method for occasional maintenance. You can for example use this after upgrading to eZ Publish 4.3 in order to clean up your existing setup.
 Run the following script (how to do this depends on your system):

bin/php/clusterbinarypurge.php

Please note that if you are running eZ Publish 4.5 or higher the script should be executed according to the following example, as the script has been renamed from clusterbinarypurge.php to clusterpurge.php:

bin/php/clusterpurge.php

If needed you can use the following options (Use --help to view all possible options):

The second way is by means of a cronjob and should be used for regular maintenance. The necessary cronjob is located here:

cronjobs/clusterbinarypurge.php

Please note that for eZ Publish 4.5 or higher versions the cronjob is the following, as it has also been renamed from clusterbinarypurge.php to clusterpurge.php:

cronjobs/clusterpurge.php

This cronjob is by default part of a cronjob named cluster_maintenance. Run it with the following script from the root of the eZ Publish directory:

$php runcronjobs.php cluster_maintenance -s ezwebin_site

Note that "$php" should be replaced by the path to your php executable. Also how to run a script can differ depending on your system. Please consult your systems manual for more information.

It is recommended to run this cronjob weekly, although it can be done more frequently for websites where binary files are removed frequently. For more information please visit our Issue Tracker: issue 015793.

Clean a DFS cluster install from stale DB files

A new script has been added for the purpose of cleaning a DFS cluster install from stale files in DB that do not exist on NFS and the opposite too. Run the following script to clean stale DB files:

bin/php/dfscleanup.php

Note: DFS cleanup is only available on eZ Publish versions 4.6 and above.

 Options:

It is recommended to first run it WITHOUT the -D switch to see which files are going to be removed. For more information please visit our Issue Tracker: #018508.

Note: ANY file located in MountPointPath is likely to be removed. Thus any file that is NOT contained in eZ Publish cluster will be removed if using -D switch. Please read DFS installation guide and issue #19059 for more information.

Two new options have been added to dfscleanup.php: iteration-limit and path. The first one limits how many items are fetched at the same time when purging, and the second one limits the path we check items for, like var/ezwebin_site/storage.

--path=VALUE                     Path to limit checks to (e.g.: <span class="code-keyword">var</span>/storage/content - Default: <span class="code-keyword">var</span>/)
--iteration-limit=VALUE       Amount of items to remove in each iteration when performing a purge operation. Default is all in one iteration.
Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2013 eZ Systems AS (except where otherwise noted). All rights reserved.