July 31st, 2003, 06:23 AM
C background program on webserver?
Apologies if this is not the right forum but I think C is the language that is most likely to solve my problem.
I've been developing a database application that is accessible from a webpage. What I would like to create is some batch/background program that accesses the DB, say every 10 minutes or something, and does some administration (i.e. updates or whatever).
I know that such a program can be written using C but would that run on the webserver? Would the ISP have to have a C compiler or something? I'm not very up on the admin side of C programs although I have worked on some of the programming side.
Or is there a different way of solving this problem?
I greatly appreciate any pointers here, thanks.
July 31st, 2003, 08:16 AM
google cron (unless you be on Windows)
It makes no nevermind what language you use to run programs, either as part of a web server (i.e., CGI) or for 'background' processes. Perl works just as well (not that I am a fan of Perl, just so you know). I am presuming that your ISP has a *nix variant on their servers and almost everyone has Perl installed and I am sure that all have a C/C++ compiler installed (usually just called 'cc'). You need to have shell access in order to use the compiler and to set up cron jobs (telnet, or preferably ssh). Some ISPs have turned off cron access to their users because poorly written cron jobs can be a burden to the server (but so can a poorly written CGI program as well).
Another thing: Most modern databases have the ability to run periodic tasks, check yours maybe you can simply create a job and have it take care of itself.
July 31st, 2003, 09:27 AM
that's great, thanks mitakeet.
I thought about the possibility of a job running within the DB, I'll look into that as well.