Figuring out Crons


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Figuring out Crons
# 1  
Old 10-12-2007
Question Figuring out Crons

Hello,

I've built a news site using SimplePie to pull in a set of feeds and display them on a page. The caching is working but the problem is that the first initial load is slow. After that, you can hit refresh and it loads very quickly. I'd like to eliminate that first slow load by creating a cronjob, which is what I've heard many other people do. I'm very new to crons and programming in general so hopefully someone can help me understand this.

I found one example of a guy using the following cron to automatically visit his page and he syncronized the cache duration, thus eliminating any slow starts:

Code:
0,15,30,45 * * * * wget -q --spider http://thewebsite.com

The problem I found was that my host doesn't support wget (or lynx, or ssh) so I've been trying to write a cron that will achieve the same results but using either curl or php. Here is what I have so far:

Code:
*/15 * * * * curl --silent --compressed http://www.mysite.com/index.php

Code:
*/15 * * * * php /home/username/public_html/index.php

Again, I found these examples from reading other resources so I'm not entirely sure what they're doing or if they're correct for my situation. I've also set the cache duration to match at 15 minutes. When I run either the curl or php cron above, in my e-mail I receive the entire html source for the specified index.php. I'm assuming this means they're working correctly, but still my news page has that initial slow load. I'm open to any thoughts or ideas. Thanks in advance.
# 2  
Old 10-12-2007
If you run the php command like that you will bypass the webserver so it may not be cached, it depends what type of chache you are using.

You probably have the "ab" apache benckmarking tool, you can pass a URL to it and it will load the page through the webserver.
# 3  
Old 10-12-2007
Thanks for the fast response, Reborg.

I'm not sure what type of cache I'm using. Is there a quick way to find out? It's whatever is default when using SimplePie, because I haven't changed it.

Could you please describe how I might use the "ab" apache benckmarking tool? I have not heard of it before and would not know where to begin. If you could provide an example of how I would use that to pass the url through, I would really appreciate it. Again, thank you for the reply.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Debian

Need help figuring out how to use my Debian Partitions

Greetings, I've installed my Debian Server over 4 months ago, I didn't quite understand what the paritions were for, but the server provider made my partitions. Anyway I was putting most of my files in /gserver and it ran otu of space quickly when in the store page it says 2tb I barely used 18gb... (2 Replies)
Discussion started by: debianguy4
2 Replies

2. Shell Programming and Scripting

Need help figuring out how to create sharable functions in Perl

I am somewhat new to Perl. I have Googled Perl one liners and worked with the MIME::Lite library to send emails with attachments. But I have not done any real Perl scripting. I need to write a script to install code for our application using an Oracle database with DBI, and to track in the... (4 Replies)
Discussion started by: gandolf989
4 Replies

3. UNIX for Dummies Questions & Answers

Execution Problems with Crons

Buddies, cron is not executing any monitoring scripts for 'Oracle' user in Red Hat Linux 5. Details about the cron job :- oracle@localhost ~]$ crontab -l 15 7 * * * /home/oracle/tab.sh The tab.sh script when firing manually is working fine. Any inputs/advice will be great for me. (12 Replies)
Discussion started by: sandip250382
12 Replies

4. Shell Programming and Scripting

figuring out an awk one liner

I have googled around a bit and could not find an answer to how this works: echo $STRING | awk '$0=$NF' FS= I know what each part is doing. The record is being set to equal the last field and the field separator is being set to null so that each character is considered a field. Why can FS= be... (4 Replies)
Discussion started by: benalt
4 Replies

5. Shell Programming and Scripting

figuring out wildcards

I'm trying to delete everything between ( and ) in a line, ie: ( start xxxx, end xxx ). there is uppercase, lowercase and numbers in the parans. and are of varied length. I tried this: sed 's/()//' infile > outfileI'm not understanding the wildcard use in brackets (2 Replies)
Discussion started by: dba_frog
2 Replies

6. UNIX for Dummies Questions & Answers

Crons -Last run time and errorlog

Hi There are few crons running under my account. How to check the last run time of the Cron and if it has run successfully without any errors. Also if there are any errors while running, will the errors be stored some where? How to check the status of all the Crons? Thanks Ashok (3 Replies)
Discussion started by: ashok.k
3 Replies

7. Shell Programming and Scripting

Working With Crons

It said I had to approve them through here or something because they won't work and everyone on my site Is gettin pissed off. Please help (3 Replies)
Discussion started by: hell-on-earth
3 Replies

8. UNIX for Advanced & Expert Users

problems figuring out dns

Im on an OS X 10.4 Mac server running bind 9.3, I just replaced the entire network with cisco hardware, all machines including servers now have private ip addresses that t he firewall resolves. I need to have a dns that works for both internal and external connections. any help would be great! (1 Reply)
Discussion started by: nbredthauer
1 Replies

9. SCO

Multple crons at boot

I am running SCO on a Netfinity system and two crons are started on bootup, but only after the system is brought down hard. i.e. running haltsys, reboot, or by a power outage. Has anyone seen this before and know a resolution to stop it? (0 Replies)
Discussion started by: ertzman
0 Replies

10. UNIX for Dummies Questions & Answers

Crons executed multiple times.

For some reason my crons are being executed twice. Any suggestion?? I'm currently on 5.8 (2 Replies)
Discussion started by: shorty
2 Replies
Login or Register to Ask a Question