I´ve never written a daemon before and I am trying to write a rather complex one that has to connect to a MYSQL database to see if it is time (or past time) to perform a ftp retrieval, then try to retrieve some ftp files if the time is right. Then it needs to import the ftp data into the MYSQL database, and finally update several associated MYSQL tables. Then wait & loop back, of course.
I generally write in php. C syntax is no problem for me in terms of straight coding, but it has been so long that I have no idea what tools and libraries would be preferred to handle such tasks.
What I am looking for is some examples of working daemons that do more than write to a log file. Specifically, I like to see how somebody has gotten a working daemon to retrieve an ftp file and query and/or update a MYSQL database. I´m curious about how people handle errors and what kind of objects they use to do handle database calls and file transfers.
I am using the 10.04 Ubuntu server.
Thank you for your consideration.