LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Fedora
User Name
Password
Fedora This forum is for the discussion of the Fedora Project.

Notices


Reply
  Search this Thread
Old 05-19-2006, 01:42 AM   #1
mmoor
Member
 
Registered: May 2006
Distribution: Fedora core 5
Posts: 37

Rep: Reputation: 15
crontab question


my crontab
-----------
0 */2 * * * /home/joe/run.cgi &
------------
But that runs the cron job at 1Am every day and not every 2 hours?
Someone any clue why ?
 
Old 05-19-2006, 01:01 PM   #2
pljvaldez
LQ Guru
 
Registered: Dec 2005
Location: Somewhere on the String
Distribution: Debian Wheezy (x86)
Posts: 6,094

Rep: Reputation: 272Reputation: 272Reputation: 272
Don't know why it's not working. But I suspect it has something to do with the "&" at the end. Maybe it's not detaching the process properly...

If you're worried about the */2, you can change it to 0-23/2 instead...
 
Old 05-20-2006, 12:34 AM   #3
mmoor
Member
 
Registered: May 2006
Distribution: Fedora core 5
Posts: 37

Original Poster
Rep: Reputation: 15
i will try that.. thanky
 
Old 05-20-2006, 01:08 AM   #4
mmoor
Member
 
Registered: May 2006
Distribution: Fedora core 5
Posts: 37

Original Poster
Rep: Reputation: 15
and 1 more newbi question more..

Also in crontab.
0 * * * * php /usr/temp/test.php

Error message, can't find php

is there something else i have to do.. Php is runing as api in apache.

if i go into a shell and type php it finds it
 
Old 05-20-2006, 07:24 AM   #5
michaelk
Moderator
 
Registered: Aug 2002
Posts: 19,702

Rep: Reputation: 3221Reputation: 3221Reputation: 3221Reputation: 3221Reputation: 3221Reputation: 3221Reputation: 3221Reputation: 3221Reputation: 3221Reputation: 3221Reputation: 3221
You need to include the entire path to php. To run php from the command line add the following as the first line and change the file permissions to be executable.

#!/usr/bin/php -q

Then you do not need to include php. i.e.

0 * * * * /usr/temp/test.php
 
Old 05-20-2006, 03:50 PM   #6
mmoor
Member
 
Registered: May 2006
Distribution: Fedora core 5
Posts: 37

Original Poster
Rep: Reputation: 15
ahhh.. now that stuff works, thanks guys
 
  


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
crontab question linuxtesting2 Linux - General 5 09-21-2004 04:54 PM
crontab question... j_miguel_y Linux - General 1 06-23-2004 05:19 PM
crontab question DriveMeCrazy Linux - Newbie 1 05-23-2004 12:25 PM
Crontab question mikeshn Linux - General 3 09-06-2003 06:26 PM
Crontab Question linear Linux - Software 4 01-11-2003 02:42 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Fedora

All times are GMT -5. The time now is 08:00 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