Gossamer Forum
Home : Products : Links 2.0 : Discussions :

CronTab like program when you do not have Crontab access.

Quote Reply
CronTab like program when you do not have Crontab access.
I do not have access on my server to the crontab. Does anyone know of any good scripts that I can use to put on my server that will allow me to do auto cleanup, etc.

Thanks
Quote Reply
Re: CronTab like program when you do not have Crontab access. In reply to
What kind of server are using? If it is NT, there is a way to run cron via WinAt, which is located in the NT Resource Kit.

I do not know of any PERL or CGI scripts that will automatically run another script.
If you find out, let us know.

------------------
Eliot Lee
Founder and Editor
Anthro TECH, L.L.C
http://www.anthrotech.com/
info@anthrotech.com
==========================
Coconino Community College
http://www.coco.cc.az.us/
Web Technology
Coordinator
elee@coco.cc.az.us
Quote Reply
Re: CronTab like program when you do not have Crontab access. In reply to
My server uses Linux so I need a perl script for linux. I use win/95 apache on my home computer for research and developement (win/95/98 sucks! but need it for other programs.) Will let you know if I find anything. I suppose if I do not find anything I will have to dig deaper in the books and write my own.
Quote Reply
Re: CronTab like program when you do not have Crontab access. In reply to
There *is* a way... it's not perfect, and it works best for once a day, or random updating.

If you have a cgi-program that requires parameters, or to be called from a <POST> command, a certain number of calls a day will not have the required data. Either browsers mess up, people don't fill in all fields, or someone tries to hack the program (innocently or maliciously).

If you scan your input for missing, erroneous, or otherwise 'invalid' data, and every time you find it, you call your "pseudo-crontab program" to run, you have effectively (albeit haphazardly) accomplished your goal.

If you only want the program to run ONCE per day, or per unit time, write a small "Updted_already" file, and put in the date and/or time. If that date contained in that file is newer than the required update cycle, ignore it, otherwise, rewrite the file, and do your thing.

Poor man's crontab Smile
Quote Reply
Re: CronTab like program when you do not have Crontab access. In reply to
Looks good on paper (er... screen). I am wondering if the implementation will work as well. It certainly would be an interesting project.
Quote Reply
Re: CronTab like program when you do not have Crontab access. In reply to
There is no way a cgi script can emulate a cron event. In order for a script to do it, it would have to run 24 hours a day, waiting for the time to execute the event. Your script would time out and terminate long before that.

If you are on a Linux system and they will not allow you to build a cron event, you might consider changing ISPs.

I hope this helps.
Quote Reply
Re: CronTab like program when you do not have Crontab access. In reply to
To see the logic in action check out the HamCards script (from the HamWeather people).

They have a flag in their program that allows you to update the database several different ways. One way is when called from the browser without parameters, update the database. This is relatively automatic <G>

I've had the program run within an hour of midnight every day so far... that's good enough for government work Wink

The same principle applies to all sorts of housekeeping... and it does work.

But, I guess, it depends on how busy your site is.

To run more frequently, just attach it to more error conditions. With all the AOL people out there, there is always an "Invalid Email" error condition available when they forget to put the @aol.com in their addresses.

On script driven sites, finding error conditions is *NOT* very hard Wink