TIP: Click on subject to list as thread! ANSI
echo: rberrypi
to: MARTIN GREGORIE
from: NY
date: 2020-09-10 20:38:00
subject: Re: Pi Hardware

"Martin Gregorie"  wrote in message
news:rjdo75$6sa$1@dont-email.me...
> On Thu, 10 Sep 2020 17:22:55 +0100, 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.
>>
> That sounds like a case for using a cron job. See "man cron" for how to
> manage crond, the cron daemon, and "man 5 crontab" for how to write a cron
> job script.
>
> crond is a daemon process (i.e. started on boot and waits for stuff to
> do) that looks for shell scripts to execute, runs any that it finds, and
> e-mails results and/or errors to the user who submitted the job.
>
> Cron jobs can be run once every hour, day, week or month by putting a
> script in the appropriate directory, e.g scripts in /etc/cron.daily are
> run once a day, typically somewhat after midnight. In these cases the
> script contains details of which user it should be run under and where to
> send any data written to stdout or stderr, with the default being to run
> it under root and to send output to root.

Yes I'd already identified that cron would be a good way of triggering the
upload. It's a matter of working out what can be run (via cron) at the Pi
which makes a remote web server add data to an SQL database held on its
server, preferably searching for each row of data that is about to be added
to check that it doesn't already have it - to make the process resilient to
temporary outages which would otherwise cause it to miss data if there was
no catchup mechanism.

It's on the "round tuit" list - a nice little refinement to what I can do
locally at present by searching the local CSV files that Cumulus creates.


I'll probably write the query-and-display software first, manually uploading
each month's data into the SQL table, and leave the automatic cron-driven
uploading with resilience until later.

--- 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™.