TIP: Click on subject to list as thread! ANSI
echo: rberrypi
to: ALL
from: THE NATURAL PHILOSOPHER
date: 2020-09-11 05:22:00
subject: Re: Pi Hardware

On 10/09/2020 17:22, NY wrote:
> Yes the only bit I haven't cracked is running a process on the Pi that
> uploads data to the web server (maybe in daily batches, maybe every 10
> minutes when a new entry is added to the local log file on the Pi) so as to
> add it to the SQL table. Doing it manually is easy enough from cPanel
> accessed by web page (LOAD DATA INFILE from a file on the Pi or Windows
> PC) - I've done it for a big database of WWI soldiers' details that my
> parents gradually add to as they do research, so I save an Excel
> spreadsheet
> as a CSV file, wipe the SQL table of its existing data, and then upload the
> whole lot again (including additions and changes). It would be nice to find
> a way of automating this, preferably so it only uploaded data that it
> doesn't already have.

OK, the easy start way for this kind of thing is to create a script that
runs under cron on the Pi.

That will 'push' the data to the web server.

The web servers side is not too hard - simply create a page that takes
form variables so e.g. you can call it with:

http:weather.mysite.com/upload.php?temp=37.2&pressure=987.9....and so on

To upload simply use curl in the cron script. How you read the data and
get it to curl is your problem!

https://davidwalsh.name/curl-post-file


--
“it should be clear by now to everyone that activist environmentalism
(or environmental activism) is becoming a general ideology about humans,
about their freedom, about the relationship between the individual and
the state, and about the manipulation of people under the guise of a
'noble' idea. It is not an honest pursuit of 'sustainable development,'
a matter of elementary environmental protection, or a search for
rational mechanisms designed to achieve a healthy environment. Yet
things do occur that make you shake your head and remind yourself that
you live neither in Joseph Stalin’s Communist era, nor in the Orwellian
utopia of 1984.”

Vaclav Klaus

--- SoupGate-Win32 v1.05
* Origin: Agency HUB, Dunedin - New Zealand | FidoUsenet Gateway (3:770/3)

SOURCE: echomail via QWK@docsplace.org

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.