#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2003
    Location
    UK
    Posts
    48
    Rep Power
    12

    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.
  2. #2
  3. I'm Baaaaaaack!
    Devshed God 1st Plane (5500 - 5999 posts)

    Join Date
    Jul 2003
    Location
    Maryland
    Posts
    5,538
    Rep Power
    244

    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.

    My blog, The Fount of Useless Information http://sol-biotech.com/wordpress/
    Free code: http://sol-biotech.com/code/.
    Secure Programming: http://sol-biotech.com/code/SecProgFAQ.html.
    Performance Programming: http://sol-biotech.com/code/PerformanceProgramming.html.
    LinkedIn Profile: http://www.linkedin.com/in/keithoxenrider

    It is not that old programmers are any smarter or code better, it is just that they have made the same stupid mistake so many times that it is second nature to fix it.
    --Me, I just made it up

    The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man.
    --George Bernard Shaw
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2003
    Location
    UK
    Posts
    48
    Rep Power
    12
    that's great, thanks mitakeet.
    I thought about the possibility of a job running within the DB, I'll look into that as well.
    Thanks again.

IMN logo majestic logo threadwatch logo seochat tools logo