LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-31-2009, 03:21 AM   #1
vipin_jss
Member
 
Registered: Aug 2007
Posts: 45

Rep: Reputation: 15
php refresh using cron jobs


hi am very new to cron and im suing the crom for updating(refreshing)the site in every 15 minute how can i do this ?
 
Old 07-31-2009, 03:25 AM   #2
centosboy
Senior Member
 
Registered: May 2009
Location: london
Distribution: centos5
Posts: 1,137

Rep: Reputation: 116Reputation: 116
Quote:
Originally Posted by vipin_jss View Post
hi am very new to cron and im suing the crom for updating(refreshing)the site in every 15 minute how can i do this ?
Code:
crontab -e
then



Code:
*/15 * * * * /path/to/command

save changes.
 
Old 07-31-2009, 03:27 AM   #3
vipin_jss
Member
 
Registered: Aug 2007
Posts: 45

Original Poster
Rep: Reputation: 15
how i refresh my page and what shoul i put in /path/to/command im a newbie in the cron
 
Old 07-31-2009, 03:28 AM   #4
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978
Add a crontab entry using crontab -e. To run a job every 15 minutes you can try something like:
Code:
*/15 * * * * /path/to/command blah blah blah
use always full path for the commands/scripts to run from crontab (and for filenames inside the scripts), since the cron environment is different from that of a login shell and it has a very limited PATH. For details about settings a crontab:
Code:
man 5 crontab
 
Old 08-03-2009, 04:18 AM   #5
centosboy
Senior Member
 
Registered: May 2009
Location: london
Distribution: centos5
Posts: 1,137

Rep: Reputation: 116Reputation: 116
Quote:
Originally Posted by vipin_jss View Post
how i refresh my page and what shoul i put in /path/to/command im a newbie in the cron
depends what you mean by refresh.
if you are meaning meta refresh, then a cron is not needed for this

insert this code into pages to be refreshed

Code:
<meta http-equiv="refresh" content="5" />
the '5' indicates seconds.

I have written this on the assumption that a meta refresh is what you are after as you are not very clear in your question.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
cron hourly, daily, cron.d jobs don't execute eggsmartha Linux - General 3 09-17-2007 06:37 PM
cron jobs bilal_linux Linux - Software 10 04-25-2007 07:49 AM
Cron Jobs christo512 Linux - Software 1 02-09-2006 09:19 AM
Daily Cron jobs with a PHP file Gargomel7 Programming 7 09-13-2003 07:21 PM
cron jobs Zyanid Linux - Software 0 08-27-2002 05:10 AM


All times are GMT -5. The time now is 12:03 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration