Caution: This documentation is for eZ Publish legacy, from version 3.x to 5.x.
For 5.x documentation covering Platform see eZ Documentation Center, for difference between legacy and Platform see 5.x Architecture overview.

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):

  • dry-run: to display deleted files, without deleting anything (only applies to the bin script)
  • iteration-sleep: to pause time, in seconds, between each batch of delete operations. The default value is 1 second. Can be used as a floating point number.
  • iteration-limit: to set how many files should be deleted by SQL fetch. The default value is 100, but note that increasing this value will increase the memory footprint.
  • memory-monitoring: to monitor memory usage in var/log/clusterbinarypurge.log.
  • scopes: to specify the file types to purge. Possible values are: classattridentifiers, classidentifiers, content, expirycache, statelimitations, template-block, user-info-cache, viewcache, wildcard-cache-index, image, binaryfile or media.
  • expiry: to choose the number of days since the file was expired. Only files older than the defined value will be purged. Default is 30, minimum is 1.

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:

  • -S Check files on DFS share against files in the database
  • -B Checks files in database against files on DFS share
  • -D Delete nonexistent files

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.

Ester Heylen (16/04/2010 1:17 pm)

Ricardo Correia (17/04/2013 2:01 pm)

Ester Heylen, Geir Arne Waaler, Jérôme Vieilledent, Andrea Melo, Ricardo Correia


Comments

There are no comments.