Free Web Hosting Forum
(#1 (permalink))
Old
Junior Member
kazuhime89 is on a distinguished road
 
Posts: 11
Join Date: Aug 2010
Default cron job not running - 08-24-2010, 04:19 AM

Hi all,
I've set a cron job but its not running, does anyone have any idea why?
the file I want to run is a php file, does it make any difference?
Reply With Quote
Sponsored Links
(#2 (permalink))
Old
drums's Avatar
Senior Member
drums is on a distinguished road
 
Posts: 579
Join Date: Aug 2010
Location: Oz
Default 08-24-2010, 04:22 AM

Hi kazuhime

I would recommend you log a helpdesk ticket using the "Get Help" tab at the top right of the screen in members cpanel.

It could be your cron script, but to be honest, I have also had problems with a cron job on one of the servers that recently changed dc's (server19), which used to work perfectly.

So log a ticket.

drums
Reply With Quote
(#3 (permalink))
Old
Junior Member
kazuhime89 is on a distinguished road
 
Posts: 11
Join Date: Aug 2010
Default 08-24-2010, 04:26 AM

Ok, thx drums.
I'll log a ticket now.
Is ur cron job working now?
Reply With Quote
(#4 (permalink))
Old
drums's Avatar
Senior Member
drums is on a distinguished road
 
Posts: 579
Join Date: Aug 2010
Location: Oz
Default 08-24-2010, 04:34 AM

Yes.

If you want to be doubly sure, we can use the time while your ticket is being processed to check that it's also not your script or the way you've set it up!

Post some details here of what you're trying to do here (eg: your cron job details, and your cron script (if it's not containing sensitive code such as passwords, etc)

drums
Reply With Quote
(#5 (permalink))
Old
Junior Member
kazuhime89 is on a distinguished road
 
Posts: 11
Join Date: Aug 2010
Default 08-24-2010, 04:38 AM

Oh2, hehe. Then, if its not troubling u.

I'm making a facebook app which can publish to users wall periodically, like every week with one post. Its a fortune telling app,so every week the users will automatically have a post on their wall. That's basically it.

I needed a cron job for that right, so here's the coding.

Last edited by kazuhime89; 08-24-2010 at 05:03 AM.
Reply With Quote
(#6 (permalink))
Old
drums's Avatar
Senior Member
drums is on a distinguished road
 
Posts: 579
Join Date: Aug 2010
Location: Oz
Default 08-24-2010, 04:59 AM

okay.

One immediate thought looking at the first line, is that when you use a script through cron, the directory will not be automatically set to public_html.

So, assuming your files are in /public_html/ then add a new first line:

Code:
chdir('./public_html/');
That might be enough to make it work...

I'll have a look at the rest now

drums
PS: once you get it working, I would edit your post above and remove the code section for security reasons
Reply With Quote
(#7 (permalink))
Old
Junior Member
kazuhime89 is on a distinguished road
 
Posts: 11
Join Date: Aug 2010
Default 08-24-2010, 05:01 AM

I see, I see.
Hehe, let me try that first.
Reply With Quote
(#8 (permalink))
Old
Junior Member
kazuhime89 is on a distinguished road
 
Posts: 11
Join Date: Aug 2010
Default 08-24-2010, 05:14 AM

Drums, it still doesn't work...
I added the code u gave me, abd I changed the path file at the cron job tab at the cpanel to

php -f/home/YOUR_CPANEL_USERNAME/public_html/cron2.php

but it still doesn't work somehow.
Reply With Quote
(#9 (permalink))
Old
drums's Avatar
Senior Member
drums is on a distinguished road
 
Posts: 579
Join Date: Aug 2010
Location: Oz
Default 08-24-2010, 06:20 AM

Hi Kaz,

First step, I would suggest make sure that the script works (outside of cron) by accessing it from yoursite.com/cron2.php. I did a quick check and it's not returning an error (good start).

You're going to need to add some debug data in there to make sure it's working okay as there's currently no output to tell you what's going on.

I'm guessing the problem lies with the facebook API client, however, as a start, just make sure you add an echo command to check it is accessing the db data correctly
eg:
Code:
 echo $fortune."<br>";
Might also help to check it's pulling in the user and session key data correctly too.

I'm not familiar with the facebook api, but let me do some digging.

drums

Last edited by drums; 08-24-2010 at 06:26 AM. Reason: [I take back my apology for asking you to raise a ticket! :D]
Reply With Quote
(#10 (permalink))
Old
Junior Member
kazuhime89 is on a distinguished road
 
Posts: 11
Join Date: Aug 2010
Default 08-24-2010, 06:23 AM

Drums!!

Its working now!
The problem was in the command line, the webmaster gave me the correct one.
Issuing a ticket did work. Hehe~ and this one also helped. chdir('./public_html/');
Hehe, thank you soooooooo much for all your trouble!
*hugs,hugs, extra hugs*

-Kazu-
Reply With Quote
Reply

Tags
cron, cron job, not working

Thread Tools
Display Modes

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
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Forum Jump



Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.5.2
vBulletin Skin developed by: vBStyles.com