PrimeSuspect Posted August 23, 2010 Share Posted August 23, 2010 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... Quote Link to comment Share on other sites More sharing options...
rulerofzu Posted August 23, 2010 Share Posted August 23, 2010 You should check with your host. Just because in your cPanel crons can be set does not mean that they are allowed to run on the server. Quote Link to comment Share on other sites More sharing options...
PrimeSuspect Posted August 23, 2010 Author Share Posted August 23, 2010 You should check with your host. Just because in your cPanel crons can be set does not mean that they are allowed to run on the server. I asked them if they are allowed to run or not , they said yes we allowed there is no limitation... Quote Link to comment Share on other sites More sharing options...
rulerofzu Posted August 23, 2010 Share Posted August 23, 2010 You should use the full path /home/kv/ Quote Link to comment Share on other sites More sharing options...
Fathom Posted August 23, 2010 Share Posted August 23, 2010 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 Quote Link to comment Share on other sites More sharing options...
PrimeSuspect Posted August 23, 2010 Author Share Posted August 23, 2010 Also when i copy/paste the link that i write CPanel to the web browser like this http://kv.mydomain.com/cron_run_minute.php?code=mycode , it works manually.. Every i copy and paste to the browser it works like 1minute 1minute.... Quote Link to comment Share on other sites More sharing options...
Shineman Posted August 23, 2010 Share Posted August 23, 2010 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. Quote Link to comment Share on other sites More sharing options...
rulerofzu Posted August 23, 2010 Share Posted August 23, 2010 [any version] Removal of 1 minute crons Quote Link to comment Share on other sites More sharing options...
PrimeSuspect Posted August 24, 2010 Author Share Posted August 24, 2010 Hello guys First of all thnx all for your help.. I solved my problem and i want to share it with you. I tried wget -c command instead of curl and now it works perfectly.. Full Code : wget -c http://www.mydomain.com/cron_run_minute.php?code=mycode Quote Link to comment Share on other sites More sharing options...
peterisgb Posted August 31, 2010 Share Posted August 31, 2010 Full Code : wget -c http://www.mydomain.com/cron_run_minute.php?code=mycode thanks sooooooo much for that, i been trying to get the crons working on my site for months thanks sooooo much....... Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.