Running 24/7 with multiple instances ...

Are you using LiveCode to create server scripts or CGIs?

Moderators: Klaus, FourthWorld, heatherlaine, kevinmiller, robinmiller

Post Reply
jrarick
Posts: 9
Joined: Sat Apr 08, 2006 2:48 pm
Location: Holt MI USA
Contact:

Running 24/7 with multiple instances ...

Post by jrarick » Sun Jan 27, 2013 2:11 pm

Thanks in advance for all your help!

Question 1
Is it possible to have a script running on an on-rev server 24 hours a day?

Question 2
And if yes - how? I've tried waiting for sixty seconds at the end of the script and calling itself again - but it seems to "stop" after a while and needs to be kickstarted again.

Question 3
If we CAN have a script running 24/7 on an on-rev server, can we have more than one running at the same time?

Thanks to all!

Jack Rarick
Sherman Systems
Braintree Athletics
Creating Video Editing Software for Coaches and Teachers

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5147
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Re: Running 24/7 with multiple instances ...

Post by Mark » Sun Jan 27, 2013 3:07 pm

Hi,

A script on a server can run in two different ways. First, it can be called by a client, which calls the website and then runs the script. This is how it is usually done. Second, you can set up a cron script to run e.g. every hour or so.

Depending on why you need this, it may be acceptable to run a script every 5 minutes. Running it all the time may be unacceptable. I really wonder why you would want a script to run continuously. A good web hosting company would disable your account if you're sharing a server with others, because you'd probably harm the people who have accounts on the same company.

If a script is initiated by a website, you can run as many instances of the script as there are clients calling it. If you are using a cron script, you might want to avoid running too many at once, but two should be fine.

Kind regards,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

jrarick
Posts: 9
Joined: Sat Apr 08, 2006 2:48 pm
Location: Holt MI USA
Contact:

Re: Running 24/7 with multiple instances ...

Post by jrarick » Sun Jan 27, 2013 8:52 pm

Thank you!

That all makes sense - sort of. But I will as I keep working at it.

The "Why" is because I can FTP data to the web site easily - getting underneath or around the proxy/Firewall that many schools have in place. Once the data gets to the web site - the script knows how to act on it.

I cannnot call the script from this of the firewall however. Go figure. It probably makes perfect sense - but I have been stymied. So my solution was to simply have the script run every minute or so, (started from somewhere OUTSIDE of the firewall/proxy) looking for data. If there was data, it would act on it and delete the data. If not data, it would just sit quiet and then look again in a minute or so.

Thanks for your help - I will still need to figure out how to place nice with the firewall/proxy.

Jack Rarick
Sherman Systems
Braintree Athletics
Creating Video Editing Software for Coaches and Teachers

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5147
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Re: Running 24/7 with multiple instances ...

Post by Mark » Mon Jan 28, 2013 3:09 am

Hi Jack,

Do you mean that FTP allows you to circumvent the firewall or that FTP would work if you find a way to circumvent the firewall?

Do you know that the revBrowser control uses either Internet Explorer (on Windows) or Safari (on Mac OS X)? If you manage to connect to your server over FTP, then you could load a URL in the revBrowser control to trigger a script on your server. A URL loaded in a revBrowser controls should pass the firewall without a problem.

Kind regards,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

jrarick
Posts: 9
Joined: Sat Apr 08, 2006 2:48 pm
Location: Holt MI USA
Contact:

Re: Running 24/7 with multiple instances ...

Post by jrarick » Tue Jan 29, 2013 2:06 pm

ON THE NOSE Mark!

Yes - triggering the script with revbrowser worked!!!

Thank you!
Braintree Athletics
Creating Video Editing Software for Coaches and Teachers

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 8421
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: Running 24/7 with multiple instances ...

Post by FourthWorld » Tue Jan 29, 2013 4:45 pm

Firewalls are usually based on ports, not user-agents. What scripts did you try before resorting to using RevBrowser?
Richard Gaskin
LiveCode Community Liaison

LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5147
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Re: Running 24/7 with multiple instances ...

Post by Mark » Tue Jan 29, 2013 5:14 pm

Cool! You're welcome, Jack!

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

Post Reply

Return to “CGIs and the Server”