LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (http://www.linuxquestions.org/questions/linux-general-1/)
-   -   Crontab is not working--plz look into (http://www.linuxquestions.org/questions/linux-general-1/crontab-is-not-working-plz-look-into-525897/)

JunaidAli 02-05-2007 06:52 PM

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

wjevans_7d1@yahoo.co 02-05-2007 08:09 PM

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.

JunaidAli 02-05-2007 08:15 PM

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

wjevans_7d1@yahoo.co 02-06-2007 05:06 AM

So what happens when you do this?

30 14 * * * date >> somefileyouhavewriteaccessto

JunaidAli 02-06-2007 11:35 AM

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

DotHQ 02-06-2007 12:00 PM

/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.

JunaidAli 02-06-2007 01:01 PM

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

DotHQ 02-06-2007 01:09 PM

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.

JunaidAli 02-06-2007 01:43 PM

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

JunaidAli 02-07-2007 01:27 PM

No Friends It didn't worked.. :(

JunaidAli 02-07-2007 01:54 PM

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

JunaidAli 02-07-2007 06:51 PM

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


All times are GMT -5. The time now is 10:22 PM.