Closed Thread Icon

Topic awaiting preservation: Is this a silly thing to do with CRON jobs? Pages that link to <a href="https://ozoneasylum.com/backlink?for=28266" title="Pages that link to Topic awaiting preservation: Is this a silly thing to do with CRON jobs?" rel="nofollow" >Topic awaiting preservation: Is this a silly thing to do with CRON jobs?\

 
Author Thread
H][RO
Paranoid (IV) Inmate

From: Australia
Insane since: Oct 2002

posted posted 07-28-2006 06:08

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

posted posted 07-28-2006 07:26

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

posted posted 07-28-2006 09:26

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

posted posted 07-28-2006 16:22

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

« BackwardsOnwards »

Show Forum Drop Down Menu