Gossamer Forum
Home : General : Perl Programming :

Crontab

Quote Reply
Crontab
A friend showed me his simple telenet program. The isp didn't allow telnet, but this program allows to execute commands. I could run the crontab program. Is it possible to write a cgi script which runs a program on the server and that cgi program then tries to fetch the nph-build.pl script? If so, then it should run that script successfully right? Thanks.

------------------
www.techdevelopers.com
ASP, HTML, CGI, Flash, and more!


Quote Reply
Re: Crontab In reply to
You can do that, but you need a way to trigger the program.

I'm not sure if you said you had access to cron. If so, just have it run the nph-build.cgi directly.

If not, you can use an error condition to trigger the call to run the script. I tossed that idea out a few days ago in one of the forums.

What cron does, is act like a trigger. It watches the clock, then fires off what ever it's supposed to do every specified interval. You can mimic that behavior in several ways.

1) you can have a script write a small file, and every time your main scripts are run, check the file date/time. If it's more than 6, 12 or whatever hours how, run nph-build.cgi and reset the date. Otherwise, just ignore and do what you were supposed to do.

2) wait for an error condition before checking if you should run nph-build.

Good luck Smile

Scott


Quote Reply
Re: Crontab In reply to
Thanks Scott. I've read that post a while back. Anyway, if I protected my directory with .htaccess, there will be no way for a remote script to trigger it.

But I did find this post that someone replied back to me: http://x24.deja.com/...hitnum=0&fmt=raw

It has some perl scripts that works like cron to do tasks on a NT server just like on a UNIX server. Alex may want to put this in the FAQ. . .



------------------
www.techdevelopers.com
ASP, HTML, CGI, Flash, and more!


Quote Reply
Re: Crontab In reply to
If you are on an NT server, you can use WinAt, which is available in the NT Resource Kit. It allows you to run cron processes on NT servers.

WinAt provides a GUI and command prompt options to run cron processes. Very nice program.

------------------
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 In reply to
You are trying to trigger a script on one machine, with a script on a different machine??

Why not put the trigger on the machine running the script? If you can run links, have links trigger itself. If you let people add links, and you get at least 1 or 2 a day, use that. If you don't, but you get a reasonable amount of traffic, use search errors or hits on your random link.

You'd want to add a subroutine like &cron_check to first see if enough time has elapsed, then run nph-build. If you want it to run once a day, just check the file date on your time-keeper file, update it when nph-build is run. (heck, you could use the /links/pages/index.html file as time keeper Smile )

Scott