1. Plugin installation
There are three methods available for installing this plugin.:
- Use the configure script's extension manager.
- Simplest, but your webserver must have write access to the TWiki code.
- Run the installation script manually
- Automated, works in most environments
- Do a manual installation
- If you don't trust automation, or have an unusual environment

No matter which method you choose, if you run selinux you will probably have to correct
security context assignments for the new files and/or any intermediate directories.
Using Configure
- Click on this link: configure
- Click on Extensions, Find more extensions
- Locate EcoTrashPlugin
- Click on the link and follow the directions
Runing the installation script manually
From your TWiki root directory:
- Download the
EcoTrashPlugin_installer script and the EcoTrashPlugin.md5 file from the Plugin Home (see below)
- Verify that the files were downloaded correctly:
md5sum -c EcoTrashPlugin.md5
- Run the installer:
perl EcoTrashPlugin_installer *
Manual installation
Install the prerequisite plugins. Be sure that they are at or above the minimum requred revisions.
Download the EcoTrashPlugin.zip or EcoTrashPlugin.tar.gz and EcoTrashPlugin.md5 files from the Plugin Home (see below)
Verify that the files were downloaded correctly: md5sum -c EcoTrashPlugin.md5
Expand the file that you selected in your TWiki installation directory. Content:
Correct file ownership, permissions, (and selinux contexts) for your environment.
: by default, the tar and unzip commands will set the permissions of each directory to those in the archive. This can disrupt your wiki. This can be avoided by explicitly extracting each of the files.* data/Trash/WebTrashManager.txt | User interface |
data/Trash/WebHomeEcoTrashPlugin.txt | Updated home topic for Trash web (TWiki rev below 26952) |
data/TWiki/EcoTrashPlugin.txt | Documentation |
pub/TWiki/EcoTrashPlugin/trash-manager-500.png | Screenshot |
pub/TWiki/EcoTrashPlugin/trash-manager.png | Screenshot |
lib/TWiki/Plugins/EcoTrashPlugin.pm | Perl module |
lib/TWiki/Plugins/EcoTrashPlugin/Core.pm | Perl module |
lib/TWiki/Plugins/EcoTrashPlugin/Config.spec | Configuration data |
templates/restoreattachment.tmpl | Restore attachment template |
tools/ecotrashsweeper | Perl script |
If your
Trash.WebHome does not include the text
"WebTrashManager section="WebHomeText" (is older than version 26956), replace it with
WebHomeEcoTrashPlugin:
Otherwise, you can expunge
WebHomeEcoTrashPlugin.
2. Plugin configuration and testing
- Run the configure script to configure the plugin.
- Ensure that the bin/rest script is enabled and configured for authentication. (This is part of a normal TWiki installation.)
- Check the additional settings in the Extensions section, and change if the defaults are not suitable for your installation.
-
{Plugins}{EcoTrashPlugin}{AdminGroup} - Administrator group
-
{Plugins}{EcoTrashPlugin}{MinimumAge} - Minimum retention period
-
{Plugins}{EcoTrashPlugin}{MaximumAge} - Maximum retention period
- Check the
{Plugins}{EcoTrashPlugin}{Enabled} box, in the Plugins section.
- Optional: Configure your webserver to allow access to items in the Trash by your administrator(s). This is normally prohibited for all users to prevent abuse, but it may be useful to an administrator who is reviewing Trash contents..
- Visit the TrashManager topic and verify that the plugin is active.
If you have items in Trash but the presentation looks wrong, you probably have an old version of SpreadSheetPlugin. Please upgrade it.
3. Set up and test the maintenance function
We recommend that you install a
crontab entry (or equivalent) for
tools/ecotrashsweeper to run under the webserver user. This will enable automatic maintenance of the Trash web.
Because the script deletes files and directories, it is important to verify that it is configured correctly. We
strongly recommend running it initially with the
-t=1 option to verify that it is accessing the expected directories. This will do everything except the actual deletions. (It will produce messages indicating that deletions happen - but they don't.)
You can test the script from the
TrashManager topic by clicking
Test mode and
Perform Maintenance Now. This will perform the exact actions that the maintenance script will with
-t=1, displaying the results in your browser.

If you prefer not to set up a
cron job, you can run the maintenance function from the
TrashManager topic.
If you elect that option, you can skip the rest of this section.
For a manual test run from the command line (on unix), use:
(cd /var/www/twiki; nice sudo -u *apache* perl -T -I bin tools/ecotrashsweeper -t=1)
Replace
*apache* with the user under which the TWiki webserver runs on your system.
It is important to use the webserver user so that updated files will have the correct permissions.
Once you are comfortable that the script is accessing the correct directories, you should
set up a
crontab entry for the webserver user.
A typical
crontab entry looks like:
23 00 * * * (cd /var/www/twiki; nice perl -T -I bin tools/ecotrashsweeper -q=1)
By default, the script will report every action. To suppress this, use the
-q=1 switch.
For a log, use:
23 00 * * * (cd /var/www/twiki; nice perl -T -I bin tools/ecotrashsweeper >>/var/www/twiki/data/ecotrashsweeper.log)
A somewhat simpler (equivalent) command structure on systems where perl scripts can be executed directly is:
(cd /var/www/twiki/bin; nice ../tools/ecotrashsweeper -q=1)