Perlshop 4 - Clean Script

Overview

The CLEAN script is a Unix shell script. It is designed to remove old files from the tokens, temp_customers, and temp_orders subdirectories.


Installation

  1. Put the CLEAN script file in the same directory as the perlshop.cgi file.
    (If using FTP, make sure this file is transfered in ASCII mode.)
  2. Set the file permissions to 700. (type 'chmod 700 CLEAN')
  3. Test the CLEAN script. (type './CLEAN')


Execution

This script may be executed in any of four different ways. These are described in order of ease of use.
  1. Executing CLEAN automatically via the Unix crontab command.

    Crontab is a Unix program that allows you to program the server to automatically execute a command on a regular basis. To see if your ISP supports crontab, simply type 'crontab' at the Unix command prompt. If you get an error message, please contact your ISP and ask them how to access crontab from your account.

    The manual for the crontab program can be seen by typing 'man crontab'.

    A sample crontab command file (crontab.txt) is provided with the PS4 release. This sample command file will cause crontab to execute the CLEAN script every day at 4:00 am. To use this sample command file for your Perlshop installation, you must edit the crontab.txt file so that the command file path for the CLEAN script is correct for your installation.

    Once you have made the necessary change to the crontab.txt file, you must tell Unix to start using it. This is done by typing 'crontab crontab.txt' at the Unix command prompt.



  2. Executing CLEAN automatically from Perlshop 4.

    This is not the prefered method for using the CLEAN script, and should only be used for situations where crontab (or an equivelant) is not available.

    To configure Perlshop 4 to execute the CLEAN program, you must use the CLEAN script as if it were an external plugin.

    To do this, you must add the following entry to the ps.cfg file %plugins table:

    'clean' =>
    {
    	'program' => 'CLEAN',
    	'event'   => 'after_place_order',
    	'display' => 'no'
    }
    
    This will cause the CLEAN script to execute after every new order has been placed.



  3. Executing the CLEAN script manually from Web

    You can execute the clean script from your web browser by using the ps_clean.cgi program. This program should have ben installed along with Perlshop 4, and should be called up using a similar URL.

    For example, if the URL for your Perlshop 4 installation is
    http://www.yourdomain.com/cgi/perlshop.cgi,

    then the URL to your ps_clean.cgi program should be
    http://www.yourdomain.com/cgi/ps_clean.cgi.



  4. Executing the CLEAN script manually from the Unix Shell

    The CLEAN script can always be executed by hand. Simply go to the directory where the CLEAN script is, and type './CLEAN' at the Unix command prompt.