Topic: Is this a silly thing to do with CRON jobs? (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=28266" title="Pages that link to Topic: Is this a silly thing to do with CRON jobs? (Page 1 of 1)" rel="nofollow" >Topic: Is this a silly thing to do with CRON jobs? <span class="small">(Page 1 of 1)</span>\

 
H][RO
Paranoid (IV) Inmate

From: Australia
Insane since: Oct 2002

IP logged posted posted 07-28-2006 06:08 Edit Quote

Hey all,

I have a requirement of being able to remotely setup cron jobs to do specific things at specific intervals, however i dont think this is possible..

So i was thinking of having a cronjob which runs a php script every 5 minutes. This script will see if it should be doing anything like sending out autoresponders or what not.


Is this how people use cron jobs? It needs to be fairly automated without having to change the cron jobs on the server all the time and i cant see another way of doing it

bitdamaged
Maniac (V) Mad Scientist

From: 100101010011 <-- right about here
Insane since: Mar 2000

IP logged posted posted 07-28-2006 07:26 Edit Quote

Why isn't setting up the cron job possible?

Also you can just put a loop in the script and have it sleep for 5 minutes without using the cron job.



.:[ Never resist a perfect moment ]:.

Tyberius Prime
Maniac (V) Mad Scientist with Finglongers

From: Germany
Insane since: Sep 2001

IP logged posted posted 07-28-2006 09:26 Edit Quote

A cron job that reads in an external database to decide what it's supposed to do?
Sure, I regulary use these for 'restart server' kind of scripts ( way more secure to check for the existance of a file than having the 'restart server script restart the server directly' ), why shouldn't it work for the other kind, too?


As for having a script run as a daemon - why should you add the complexity of getting a script to run forever, when you can as well just get one to run every five minutes? ( Look out for multiple startups of the same script though!)

H][RO
Paranoid (IV) Inmate

From: Australia
Insane since: Oct 2002

IP logged posted posted 07-28-2006 16:22 Edit Quote

Yeh i think i would rather use the cron job, some how it just feels a little more reliable. If the script crashed for any reason at least i know it will run again in the next 5 minutes.

It will be used to setup various things including spreading newsletter mailouts out over a period of time when server load is low, generating special download keys etc.


quote:
( Look out for multiple startups of the same script though!)



Well i guess if this happened it wouldnt care too much, i will flag the database entries of what has to be done and then unflag them, so if two scripts are running at the same time for any reason one of them will unflag it and deal with it and the other wont notice it



Post Reply
 
Your User Name:
Your Password:
Login Options: Remember Me On This Computer
 
Your Text:
Loading...
Options: Show Signature
Enable Slimies
Enable Linkwords

« BackwardsOnwards »

Show Forum Drop Down Menu