LinuxQuestions.org
Visit Jeremy's Blog.
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 11-07-2006, 06:36 PM   #1
juancha
LQ Newbie
 
Registered: Feb 2006
Posts: 17

Rep: Reputation: 0
need help with setting up a cron


Hi there

I'm very much a Linux newbie. I have a hosting account where I'm able to use cpanel which allows you to set up a cron within the cpanel web interface.

I've watched the flash tutorial the host has and I understand that you enter a Unix command to be run at intervals you specify. The thing being is that I was under the impression that you were able to specify a php script to run at certain intervals (as opposed to a command). This is what I want to do ......ie. run scripts that update my database etc.

Can anyone advise me further on how I would achieve this. eg is there a linux command that runs my php script.

Thanks


Juan.

Last edited by juancha; 11-07-2006 at 06:37 PM.
 
Old 11-07-2006, 07:28 PM   #2
hockeyman_102
Member
 
Registered: Apr 2006
Location: Washington
Distribution: Suse, CentOS, Ubuntu
Posts: 124

Rep: Reputation: 15
edit your /etc/crontab file to run your php. You may have to google for help with it, but i have a perl file that pulls info into a mysql database for me every 10 seconds. You may have to put a sleep (1min or so) in your php and just let crontab run it.
 
Old 11-07-2006, 07:28 PM   #3
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,389

Rep: Reputation: 2774Reputation: 2774Reputation: 2774Reputation: 2774Reputation: 2774Reputation: 2774Reputation: 2774Reputation: 2774Reputation: 2774Reputation: 2774Reputation: 2774
I believe means any cmd that is runnable at the Unix cmd line. So as long as you are using the cli version of php and specify the complete path to the cmd it should work, I think.
 
  


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
Setting a cron task in a script Slith(++1) Programming 3 11-21-2005 04:17 AM
Setting a cron nitaish Linux - General 6 11-03-2004 07:43 AM
problem in cron job setting gauravdream Linux - General 1 02-23-2004 12:08 AM
need help setting up a cron job !! J.I.L. Linux - Software 1 10-19-2003 08:54 PM
Setting cron by php code? VertiHost Programming 1 10-15-2003 06:41 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:23 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
Open Source Consulting | Domain Registration