Jump to content
MakeWebGames

Cron Jobs Problem


PrimeSuspect

Recommended Posts

First of all im sorry for my bad english :)

I have problem with cron job settings.My host is cpanel and it allows to set up cron jobs (munite , hour , day...).

I installed my game in a subdomain.Its like kv.mydomain.com and when i set my cron jobs like this curl kv.mydomain.com/cron_munite.php or curl kv.mydomain.com/cron_munite.php?code=mycode i have a error like below..

% Total % Received % Xferd Average Speed Time Time Time Current

Dload Upload Total Spent Left Speed

 

100 392 100 392 0 0 783 0 --:--:-- --:--:-- --:--:-- 783

100 392 100 392 0 0 783 0 --:--:-- --:--:-- --:--:-- 0

 

 

406 Not Acceptable

 

Not Acceptable

An appropriate representation of the requested resource /kv/cron_run_minute.php could not be found on this server.

Additionally, a 404 Not Found

error was encountered while trying to use an ErrorDocument to handle the request.

and When i set my cron job link like this curl /kv/cron_jobs_munite.php or curl /kv/cron_jobs_munite.php?code=mycode i have this error like below..

curl: (3) malformed

First time i got curl: (3) malformed error my 10 munites jail started till 7 munites and suddenly it stopped again.I asked my host if there is a limitation for cron munite or smt like this.He said there is no limitation.

Pls help me...

Im sorry for my bad english again...

Link to comment
Share on other sites

Try:

curl -H "Accept: */*" kv.mydomain.com/cron_munite.php?code=mycode

Technically that should solve the accept header assuming your webserver doesn't do any wierd behaviour. The suggested code means that cURL will accept any mime type in reply and then the server knows it can send "anything" back. The 406 error would occur, for example, if you sent Accept: text/* (accept text files only) and an image was to be returned which would have mime image/png (not a text file).

However that seems unlikely, do you have any unusual server config or .htaccess files (if applicable) ?

Maybe you could try setting a user-agent (I put my user agent in here).

curl -A "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/533.4 (KHTML, like Gecko) Chrome/5.0.375.127 Safari/533.4" kv.mydomain.com/cron_munite.php?code=mycode

If that works you could try setting other user agents and maybe have a "secret" user agent as well as your "mycode" if you feeling security conscious.

If you don't have any custom server config or php code that checks headers and could throw a 406 http error (on your cron_munite.php) you may want to move host.

Edit: NB: I didnt test

Link to comment
Share on other sites

I'm a newbie so this may or maynot have anything to do with this, but, my host Gator only allows cron jobs once every 15 mins..... so it needs to be replaced with something else to allow it to run, my host made the corrections to the code for me. I have had no problems since then.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...