in reply to Accessing cron job output from a web page?

I did something similar once with log files from a program. Instead of the every 5 minutes cron job, just use a CGI perl script to dynamically scan the directory for files less than 5 days old and show them. It means you only generate the HTML when needed, saving CPU time.
  • Comment on Re: Accessing cron job output from a web page?

Replies are listed 'Best First'.
Re^2: Accessing cron job output from a web page?
by OfficeLinebacker (Chaplain) on Apr 19, 2006 at 21:57 UTC
    that's a great point, traveler, and we discussed that, but we worry about the page load time if the logs are particularly large. I guess we'd just have to see if it ever bogged down the server too bad. But I like thinking in the "JIT" mindset!
      I had that thought with one of my pages. I take the middle road. Have the script check the age of the HTML file, and if it's more than X minutes old, recreate it from the log files, otherwise just show it. It saves CPU and time when many people are viewing the page at the same time, but still gives you almost current data.
        Kinda depends on how many users and how often they look. In my case I had fewer than ten users, but some looked every few minutes. At the end of the project, the page was set to do automatic refreshing because we had one user (these were project administrators) checking the logs every few seconds. With the refresh he was convinced it was "real time" :-)