LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices



Reply
 
Search this Thread
Old 02-05-2007, 07:52 PM   #1
JunaidAli
LQ Newbie
 
Registered: Feb 2007
Posts: 10

Rep: Reputation: 0
Crontab is not working--plz look into


Hi All,

I have edited crontab with following credentials...

30 14 * * * /usr/local/bin/php -f /web/disk1/virtual/xxx.com/accounts/xxx/htdocs/beta/cron/index.php

But i am not able to see results from this page
This page should add a record to a table


Junaid Al
 
Old 02-05-2007, 09:09 PM   #2
wjevans_7d1@yahoo.co
Member
 
Registered: Jun 2006
Location: Mariposa
Distribution: Slackware 9.1
Posts: 938

Rep: Reputation: 30
The best thing to do (I think) is to break this down. Is it crontab that isn't working, or is it what you're trying to do with it?

Try this:

30 14 * * * date >> somefileyouhavewriteaccessto

If that doesn't appear, then it's a crontab problem. Bring it back here with that simple example, so people won't wonder whether it's a php problem instead, or something.

If it's a php problem, try fixing that at the shell prompt, or bring that problem (without the crontab complications) back here.

Make sure also that the user who runs crontab (and therefore the user under which the crontab entry will be run) has privilege to write to the files that are to be modified.

Hope this helps.
 
Old 02-05-2007, 09:15 PM   #3
JunaidAli
LQ Newbie
 
Registered: Feb 2007
Posts: 10

Original Poster
Rep: Reputation: 0
Thanks for your Quick Response...

I have checked that PHP page by running direcly on command prompt and using Browser and working fine.... but when i put this into crontab to assume that it will run at the certain time i m not able to see the results....

i m working with $ prompt not as root..

i have a decated server within third parth premises and i only have shell access....

Thanks.. Hope you have understand scenerio
 
Old 02-06-2007, 06:06 AM   #4
wjevans_7d1@yahoo.co
Member
 
Registered: Jun 2006
Location: Mariposa
Distribution: Slackware 9.1
Posts: 938

Rep: Reputation: 30
So what happens when you do this?

30 14 * * * date >> somefileyouhavewriteaccessto
 
Old 02-06-2007, 12:35 PM   #5
JunaidAli
LQ Newbie
 
Registered: Feb 2007
Posts: 10

Original Poster
Rep: Reputation: 0
Problem is still there

Nothing Happened when i execute Following

30 9 * * * date >> /web/disk1/virtual/xxx.com/accounts/xxx.com/htdocs/beta/cron/cron.sh

xxx = myDomainName


Thanks..
Junaid Ali
 
Old 02-06-2007, 01:00 PM   #6
DotHQ
Member
 
Registered: Mar 2006
Location: Ohio, USA
Distribution: Red Hat, Fedora, Knoppix,
Posts: 542

Rep: Reputation: 33
/var/log/messages or /var/log/cron will probably have the answer, as it will tell of the error or output.

How about trying your command and write to /tmp instead of that long string you used?
30 9 * * * date >> /tmp/cron.out


If it is a permissions issue this will let you know because then cron will work.
or
Are you stopping and restarting cron after modifying the entries?
In RH I can do crontab -e then it automatically restars the cron daemon which in turn rereads what is in each cron file. So it has the most up to date copies to execute.
 
Old 02-06-2007, 02:01 PM   #7
JunaidAli
LQ Newbie
 
Registered: Feb 2007
Posts: 10

Original Poster
Rep: Reputation: 0
NO.. i m not restarting it i m just adding entry with following method

$ crontab FilePath

and with i try to edit using crontab -e its says no permission to modify

Thanks and Regards

Junaid Ali
 
Old 02-06-2007, 02:09 PM   #8
DotHQ
Member
 
Registered: Mar 2006
Location: Ohio, USA
Distribution: Red Hat, Fedora, Knoppix,
Posts: 542

Rep: Reputation: 33
Ahh, you have to be root to do crontab -e. I forgot you can't do that.

I wonder if the admin restarts the cron service via cron once a day or so. Things might have changed but from what I know your cron entry won't be picked up until the cron daemon restarts.
edit to add:
if your doing the crontab cmd it is PROBABLY restarting the cron daemon when you close the file. Try redirecting to /tmp as suggested above and see what you get.

Last edited by DotHQ; 02-06-2007 at 02:11 PM.
 
Old 02-06-2007, 02:43 PM   #9
JunaidAli
LQ Newbie
 
Registered: Feb 2007
Posts: 10

Original Poster
Rep: Reputation: 0
Okk then let me wait for one day after adding crontab entry .. because currently i am checking it after a every little while in a different ways

Like first i set time to 14:30 but it doesnot executed then i put 14;45 using other method...

but i think you are rite lemme wait for a day so cron service can be started
 
Old 02-07-2007, 02:27 PM   #10
JunaidAli
LQ Newbie
 
Registered: Feb 2007
Posts: 10

Original Poster
Rep: Reputation: 0
No Friends It didn't worked..

Last edited by JunaidAli; 02-07-2007 at 02:35 PM.
 
Old 02-07-2007, 02:54 PM   #11
JunaidAli
LQ Newbie
 
Registered: Feb 2007
Posts: 10

Original Poster
Rep: Reputation: 0
When i use this command it have created a file in tmp folder named
cron.out?

it seems like crontab is working .. so what do u suggest if i want to run my PHP page from here..

30 9 * * * date >> /tmp/cron.out
 
Old 02-07-2007, 07:51 PM   #12
JunaidAli
LQ Newbie
 
Registered: Feb 2007
Posts: 10

Original Poster
Rep: Reputation: 0
Finally It worked Only Problem was File System .. after consulting with Hosting Company they said save your files should in ASCII so i did and it starts working.....

Thanks to All of Above For Replying

Junaid Ali
Software Engineer
Royal Cyber
www.royalcyber.com

Last edited by JunaidAli; 02-13-2007 at 07:32 PM.
 
  


Reply

Tags
cron, crontab, junaid


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 On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
crontab plz help user52 Linux - Newbie 5 11-30-2006 12:14 PM
Crontab Not working appropriate? roclok Linux - Software 9 06-16-2006 12:34 AM
crontab not working durgap Linux - General 6 09-01-2005 03:38 PM
crontab not working subaruwrx Linux - Newbie 8 08-17-2004 10:12 PM
Crontab not working Neorio *BSD 1 12-02-2003 08:34 PM


All times are GMT -5. The time now is 06:50 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration