cron jobs and LC server
Hi list I need to run a cron job every 5 minutes to process some data on a server and the job needs to stop when all data are processed. The thing is : the data will be posted only once or twice a month and it is impossible to predict when. So my idea is to set up a cron job automatically when needed and remove it when all data are processed. I found the following tutorial : http://www.thesitewizard.com/general/set-cron-job.shtml Before I make a big mistake I thought it would be wise to ask specialists on this list if it would be safe to do that from within a LC server script... The idea is : a specific LC script would be used to set up and remove the cron, which in turn would trigger another script every 5 min to process data. Thanks. jbv ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: cron jobs and LC server
Hi It should be possible to that, my concern would be that for the LC script to create remove the cron scripts, it would need sufficiant privlages to do so, which is not great for security. Although there a few ways around this, it can be more trouble than its worth. It would also depend on how everything is being hosted. e.g. on shared hosting, this probably would not be possible. I would just set the cron script and leave it to every 5 minutes - it will make your life much simpler. If there is no data to process, then the script can exit and do nothing etc. Its affect on server load will be negligible. Simon On Mon, Oct 6, 2014 at 10:12 AM, wrote: > Hi list > I need to run a cron job every 5 minutes to process > some data on a server and the job needs to stop when > all data are processed. The thing is : the data will be > posted only once or twice a month and it is impossible > to predict when. > So my idea is to set up a cron job automatically when > needed and remove it when all data are processed. > > I found the following tutorial : > http://www.thesitewizard.com/general/set-cron-job.shtml > Before I make a big mistake I thought it would be wise to > ask specialists on this list if it would be safe to do that from > within a LC server script... > The idea is : a specific LC script would be used to set up and > remove the cron, which in turn would trigger another script > every 5 min to process data. > > Thanks. > jbv > > > ___ > use-livecode mailing list > use-livecode@lists.runrev.com > Please visit this url to subscribe, unsubscribe and manage your > subscription preferences: > http://lists.runrev.com/mailman/listinfo/use-livecode > ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: cron jobs and LC server
Hi Simon Thanks for your reply. Yes, security and server load are my main concerns. It is a dedicated server, but there are already quite a few cron jobs running on it. Therefore I thought it wasn't a good idea to add another one that would simply exit most of the time... jbv > Hi > > It should be possible to that, my concern would be that for the LC script > to create remove the cron scripts, it would need sufficiant privlages to > do > so, which is not great for security. Although there a few ways around > this, > it can be more trouble than its worth. It would also depend on how > everything is being hosted. e.g. on shared hosting, this probably would > not > be possible. > > I would just set the cron script and leave it to every 5 minutes - it will > make your life much simpler. If there is no data to process, then the > script can exit and do nothing etc. Its affect on server load will be > negligible. > > Simon > > On Mon, Oct 6, 2014 at 10:12 AM, wrote: > >> Hi list >> I need to run a cron job every 5 minutes to process >> some data on a server and the job needs to stop when >> all data are processed. The thing is : the data will be >> posted only once or twice a month and it is impossible >> to predict when. >> So my idea is to set up a cron job automatically when >> needed and remove it when all data are processed. >> >> I found the following tutorial : >> http://www.thesitewizard.com/general/set-cron-job.shtml >> Before I make a big mistake I thought it would be wise to >> ask specialists on this list if it would be safe to do that from >> within a LC server script... >> The idea is : a specific LC script would be used to set up and >> remove the cron, which in turn would trigger another script >> every 5 min to process data. >> >> Thanks. >> jbv >> >> >> ___ >> use-livecode mailing list >> use-livecode@lists.runrev.com >> Please visit this url to subscribe, unsubscribe and manage your >> subscription preferences: >> http://lists.runrev.com/mailman/listinfo/use-livecode >> > ___ > use-livecode mailing list > use-livecode@lists.runrev.com > Please visit this url to subscribe, unsubscribe and manage your > subscription preferences: > http://lists.runrev.com/mailman/listinfo/use-livecode > ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode