Questions about Server

Are you using LiveCode to create server scripts or CGIs?

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
Nakia
Posts: 425
Joined: Tue Feb 21, 2012 8:57 am

Questions about Server

Post by Nakia » Mon Jan 20, 2014 4:38 am

Hi,

With my Mega Bundle I got a licence to Server I want to have a play with.
Never having it used it before I have a simple (what I think is simple) starting point that I want to try out.

Basically have a Cron job setup to 4 times a day read in the CSV files that are in a folder, crunch these files and place the contents into a local My SQL DB then move the files into a processed directory. I would like to do this is a LC Stack if possible and not in PHP...

Does anyone have some starter points/tips or lessons I might find helpful to start with ?

JGonz
Posts: 24
Joined: Wed May 22, 2013 2:21 pm

Re: Questions about Server

Post by JGonz » Mon Jan 20, 2014 9:36 pm

Hi,

you're talking of cron jobs, assume it's Linux?

A standalone called as cron job would do it, LC is awesome in string manipulating. And reading/ deleting/ saving new files wouldn't be much work. As well as connecting to a DB and running SQL queries.

Getting the right setup for your job might be a problem. I just asked a (nearly) similar question, hope we'll get good answers.

Have a good time!

edgore
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 197
Joined: Wed Jun 14, 2006 8:40 pm

Re: Questions about Server

Post by edgore » Fri Jan 24, 2014 5:33 pm

As the post above mentioned, you would not need to install server to do this - you can just create your application as a standalone and use cron to execute is on a schedule (or Windows Scheduler, or whatever for the platform you are running on).

Server is an add-in for Apache or other web servers that acts as a pre-processer, like PHP. You can put Livecode into your web pages and Livecode Server will execute the Livecode portions of the page and the results of the processing will be included with your webpage output.

sturgis
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 1685
Joined: Sat Feb 28, 2009 11:49 pm

Re: Questions about Server

Post by sturgis » Fri Oct 10, 2014 1:15 am

You can use a lc server script to do this.

The recent LC servers allow for proper use of shebang lines so you can create a script to do what you want, and have cron execute it. As long as you start the script with #!/path/to/livecode-server

Then your script (don't think you need to wrap it in <?lc ?> tags under these circumstances) set the script to executable and voila' .

Post Reply

Return to “CGIs and the Server”