DEPRECATION WARNING

This documentation is not using the current rendering mechanism and will be deleted by December 31st, 2020. The extension maintainer should switch to the new system. Details on how to use the rendering mechanism can be found here.

EXT: Table Cleaner

Author:Michiel Roos
Created:2013-03-14T14:36:59
Changed by:Michiel Roos
Changed:2013-11-18T14:34:23.882499000
Email:extensions@donationbasedhosting.org
Info 2:
Info 3:
Info 4:

EXT: Table Cleaner

Extension Key: tablecleaner

Copyright 2010-2011, Michiel Roos <extensions@donationbasedhosting.org>

This document is published under the Open Content License

available from http://www.opencontent.org/opl.shtml

The content of this document is related to TYPO3

- a GNU/GPL CMS/Framework available from www.typo3.com

Table of Contents

EXT: Table Cleaner 1

Introduction 3

General usage 4

Table Cleaner: remove deleted entries 5

Table Cleaner: remove expired entries 6

Table Cleaner: remove hidden entries 7

Overview of excluded pages 8

Administration 9

Installation 9

Known problems 10

TODO 11

Changelog 12

Introduction

When a record is deleted in TYPO3, most of the times it is not actually deleted. Many tables just set a value of 1 on the 'deleted' field. Some sites can get pretty big and a lot of content is added and removed. This means that some tables will fill up with deleted records.

There are also tables that just keep on growing. Take sys_log for example. That logs system events from the time the system was first started to the present day. In some installations the sys_log also contains a lot of PHP error messages. I have seen sys_log tables of multiple GigaBytes in size.

Also sometimes editors mark content 'hidden' to re-use it on some later date. This day may never come. It Is not uncommon to see hidden content from two years ago that is just sitting there taking up valuable space.

This extension provides a scheduler task for 'cleaning up' ever growing tables by supplying three different cleanup tasks:

  • Remove deleted entries from the database older than N days
  • Remove (or mark as deleted) hidden entries from the database older than N days
  • Remove any entries from the database older than N days

For these tasks a 'tstamp' field is required. If this field is not present in the table, it will not show up in the table listings.

General usage

In the scheduler you will find three new tasks:

  • Table Cleaner: remove deleted entries (tablecleaner)
  • Table Cleaner: remove expired entries (tablecleaner)
  • Table Cleaner: remove hidden entries (tablecleaner)

You can set a retention time in days for each task. If you need different retention times for different tables, just create separate tasks for each table and time combination.

You can find these options in page properties under the visibility section on the 'Access' tab.

img-1 Illustration 1: Exclude pages or whole page trees from the cleaning process

There is one exclusion to this rule; when cleaning the pages table, the pages themselves will be excluded from the cleaning process.

You can also recursively exclude pages from the cleaning process.

Table Cleaner: remove deleted entries

In the table cleaner task, you can select one or more tables for cleaning. You can also specify a number of days after which to actually remove the deleted records from the table. The default is 31 days.

img-2 Illustration 2: Table cleaner: remove deleted entries

If you wish to set different retentions for different tables, you can create multiple scheduler tasks and then specify a different retention time for each task.

Table Cleaner: remove expired entries

In the remove expired entries task, you can select one or more tables for cleaning. You can also specify a number of days after which to remove the records from the table. The default is 31 days.

*NB! Please note that this task is the most aggressive cleaner since it ignores the deleted and hidden flags and only looks at the 'tstamp' field when removing records.*

img-3 Illustration 3: Table Cleaner: remove expired entries

If you wish to set different retentions for different tables, you can create multiple scheduler tasks and then specify a different retention time for each task.

Table Cleaner: remove hidden entries

In the remove hidden entries task, you can select one or more tables for cleaning. You can also specify a number of days after which to remove the hidden records from the table. The default is 31 days.

img-4 Illustration 4: Table Cleaner: remove (or mark as deleted) hidden entries

Instead of outright deleting the hidden records from the table, the cleaner can mark them as being 'deleted'. If the checkbox 'Mark records as deleted' is checked, the timestamp of the expired records will be touched and the records will be marked as 'deleted'.

This will give another option to build in a 'grace period' for editors that like to 'archive' their unused content by marking it as deleted. When they discover their once hidden records have now vanished from the backend, we can still restore them from the recycle bin.

If you wish to set different retentions for different tables, you can create multiple scheduler tasks and then specify a different retention time for each task.

Overview of excluded pages

There is a backend module that shows you an overview of what pages and branches are excluded in the TYPO3 page tree or any selected branch.

img-5 Illustration 5: The table cleaner excluded pages overview

Clicking on a page title will bring you straight to the page properties of that page.

Administration

Installation

Install the extension using the extension manager.

Known problems

If you find any problems, please report them over at forge:

http://forge.typo3.org/projects/extension-tablecleaner/issues

Please take some time and make a proper report stating at least:

  • version of the extension
  • reproducibility
  • steps to reproduce
  • observed behavior
  • expected behavior

Writing a good bug report will help us to fix the bugs faster and better.

TODO

Currently we have no TODO. If you have great innovative ideas, please let us know by posting a feature request:

http://forge.typo3.org/projects/extension-tablecleaner/issues

Changelog

Version

a

Version

b

Date

c

Changes

2.4.0

a

2.4.0

b

18 November 2013

c

Add backend module for excluded page inspection

2.3.0

a

2.3.0

b

14 November 2013

c

Add option to mark hidden records as deleted instead of actually deleting them. The timestamp of the record will be touched and the task that cleans up 'deleted' records will remove them up at a later time.

2.2.0

a

2.2.0

b

13 November 2013

c

Move exclusion options to page properties

2.1.0

a

2.1.0

b

18 October 2013

c

  • Add option to exclude a list of page id's
  • Add option to make exclusion recursive
  • Refactor code; add a Base class

2.0.0

a

2.0.0

b

5 June 2013

c

  • Add task for cleaning of hidden entries
  • Rename tasks
  • Remove the term 'truncate' from the extension
  • Added Dutch translation
  • Add field validation
  • Update manual

1.0.0

a

1.0.0

b

14 March 2013

c

First release

img-6

EXT: Table Cleaner 0