.. You may want to use the usual include line. Uncomment and adjust the path. .. include:: ../Includes.txt ================== 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: EXT: Table Cleaner ================== Extension Key: **tablecleaner** Copyright 2010-2011, Michiel Roos 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: 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: 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: 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: 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: 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: 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: 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: Administration -------------- .. _Installation: Installation ^^^^^^^^^^^^ Install the extension using the extension manager. .. _Known-problems: 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: 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: Changelog --------- .. ### BEGIN~OF~TABLE ### .. _Version: **Version** ^^^^^^^^^^^ .. container:: table-row a **Version** b **Date** c **Changes** .. _2-4-0: 2.4.0 ^^^^^ .. container:: table-row a 2.4.0 b 18 November 2013 c Add backend module for excluded page inspection .. _2-3-0: 2.3.0 ^^^^^ .. container:: table-row 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: 2.2.0 ^^^^^ .. container:: table-row a 2.2.0 b 13 November 2013 c Move exclusion options to page properties .. _2-1-0: 2.1.0 ^^^^^ .. container:: table-row 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: 2.0.0 ^^^^^ .. container:: table-row 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: 1.0.0 ^^^^^ .. container:: table-row a 1.0.0 b 14 March 2013 c First release .. ###### END~OF~TABLE ###### |img-6| EXT: Table Cleaner 0 .. ######CUTTER_MARK_IMAGES###### .. |img-1| image:: img-1.jpeg .. :align: left .. :border: 0 .. :id: graphics4 .. :name: graphics4 .. :width: 100% .. |img-2| image:: img-2.jpeg .. :align: left .. :border: 0 .. :id: graphics1 .. :name: graphics1 .. :width: 100% .. |img-3| image:: img-3.jpeg .. :align: left .. :border: 0 .. :id: graphics2 .. :name: graphics2 .. :width: 100% .. |img-4| image:: img-4.jpeg .. :align: left .. :border: 0 .. :id: graphics3 .. :name: graphics3 .. :width: 100% .. |img-5| image:: img-5.jpeg .. :align: left .. :border: 0 .. :id: graphics5 .. :name: graphics5 .. :width: 100% .. |img-6| image:: img-6.png .. :align: left .. :border: 0 .. :height: 46 .. :id: graphics6 .. :name: graphics6 .. :width: 103