#!/usr/bin/perl
###################################################################
# FAKE CRONTAB									
# Distribution by Psybercore.com, Inc.	info@superscripts.com    
#
# My name is Drew Star... and I am funky http://www.mp3.com/drewstar/
#
# http://www.superscripts.com/
#             
###################################################################
# FAKE CRONTAB									
#                         
# Duplicating or redistributing this program without prior
# written consent is expressly forbidden.  You must Obtain
# permission before redistributing this software by any means.
# In all cases this copyright/license notice must remain intact.
#
# http://Marek'sScripts.w2w.cc/ 
#               
###################################################################


Copyright
====================

   Duplicating or redistributing this program without prior written consent is 
   expressly forbidden.  You must Obtain permission before redistributing this 
   software by any means. In all cases the copyright/license notice must remain 
   intact.


Description
====================

   I wrote Crone because just about every hosting company I've ever dealt with 
   either wouldn't let me run cronetab or made a big deal out of it. Crone can 
   schedule your scripts to run once an hour, once a day, once a month, or every 
   so many visitors.  If you want, it will even email you and tell you when its 
   done and what scripts it ran. Best of all Crone can be installed in a matter 
   of minutes and will run on virtually any server* with cgi capabilities.


Features
====================

	Can be used to schedule another script to run 
		- once an hour, 
		- once a day, 
		- once a month,
		- every x number of hits

	Will optionally email the webmaster each time a job is completed


Requirements
====================

	- Perl 5

	- Unix Based Web Server

	- cgi capability

	- Sendmail (optional)

	Traffic - In order for this script to run properly you must have sufficient 
			   traffic to trigger it (i.e. in order to have a job run once an hour 
			   you must have at least one hit per hour on the trigger page).


Installation Steps
====================

   A. Edit the first line of the main  script from #!/usr/bin/perl to the 
      required Perl path specified on your server. (If you don't know contact 
      somebody who does, such as a web host's technical support. Commonly it 
      can be /usr/bin/perl, /usr/sbin/perl, /usr/local/perl, etc...)

   B. Modify the variables in the crone.cgi (open it using notepad and scroll 
      down until you see the line "Define Variables:").

     1. $frequency = 500;
        ====================================================================
        If you want Crone to schedule a job every so many hits, set the number 
        here.


     2. $datafile = "crone.dat";
        ====================================================================
        The name of the file where Crone will store it's data.  If you want to 
        run multiple copies of crone in the same directory you will have to 
        rename this file for each installation.


     3. $job = ("directory/test3.cgi"); OR $job = "test1.cgi";
        ====================================================================
        The name of the script you want Crone to run. The scripts must all be 
        in, or under the directory as crone.cgi.


     4. $mail = "yes";
        ====================================================================
        Here you have two choices "yes" and "no".  If you want to be emailed 
        each time Crone does its thing select "yes", otherwise select "no".  
        Note: "yes" and "no" must be in lower case.  "YES" and "NO" will not 
        work.


     5. $sendmail="/usr/bin/sendmail";
        ====================================================================
        Enter the full path to sendmail on your server (If you don't know 
        contact somebody who does, such as a web host's technical support. 
        Commonly it can be /usr/lib/sendmail, /usr/sbin/sendmail, 
        /usr/bin/sendmail, etc...).


     6. $email = "youremail\@yourdomain.com";
        ====================================================================
        Your email address.  Make sure you include the "\" before the @ symbol.  
        If you don't it will cause the script to crash.


     7. $subject = "Crone Job";
        ====================================================================
        Enter the subject of the email notification.


   C. Upload crone.cgi and crone.dat into your cgi-bin directory using ASCII 
      mode (any other mode would make things not work).

   D. Now Chmod the cgi script to 755 and the data file 777.

   E. You are now setup to run the Crone, have fun and if you have any problems 
      feel free to contact me.


Script Usage
====================

   Crone acts just like a hidden counter on one of your web pages and is 
   activated each time someone visits your page.  You can call it either 
   through and image tag: 

   <img src="http://www.ABC.com/cgi-bin/crone.cgi?DAY" width="2" height="2">

   or through a standard SSI call:

   <!--exec cgi="/cgi-bin/crone.cgi?MONTH"-->


   The query string (after the "?") tells the script how often you want to run 
   the crone job.  Your options are "HOUR", "DAY", "MONTH", or "VISIT".  "HOUR" 
   will run the crone job once each hour, "DAY" will run the crone job once 
   each day, "MONTH" will run the crone job once each month, and "VISIT" will 
   run it every time your have the number of visitors you specified in 
   $frequency.



To Do List
====================

	- add multiaccess capabilities



