Unable to insert cron job in cpanel

Brightonian

Member
Mar 17, 2011
10
0
51
Hi all

I've been trying to insert a cron job in the cron job section of cpanel but it just won't accept the cron.
It keeps on producing an Ajax error and says to refresh and try again which I have done countless times but with no good results.
Does anyone know what is causing this as I am lost for ideas on this.
I'm using firefox and tried it with chrome and it does the same thing so don't know what else to check.

Any help in getting this sorted would be appreciated.

I've attached the error it produces and I've tried several cron commands but don't know which one will work correctly as one of them kept on filling my home directory with many 0byte "index.html*" files.
These are the commands I tried to use:

1. wget -q 'http://www.cancasa.com/system/miscellaneous/task_scheduler/' -o - > /dev/null

2. wget -q 'http://www.cancasa.com/system/miscellaneous/task_scheduler/' -o > /dev/null

3. wget 'http://www.cancasa.com/system/miscellaneous/task_scheduler/' -o > /dev/null

4. wget -q 'http://www.cancasa.com/system/miscellaneous/task_scheduler/' -o - > /dev/null; rm -f index.html

Thanks :)
 

Attachments

Last edited:

Brightonian

Member
Mar 17, 2011
10
0
51
Thanks Infopro

I've tried it with Firefox, Chrome and IE but no joy.
The site www dot cancasa dot com runs a script for property listings by owners and needs to run a task scheduler to expire listed properties.
I got the original cron command from the script writers but have had several problems with it ranging from not working correctly to dumping loads of index.html files in the home directory.

I also contacted the host and it seems they were able to insert this cron command: wget 'http://www.cancasa.com/system/miscellaneous/task_scheduler/' -o > /dev/null

but can't figure out why I can't do the same, besides I received the following message when it was run:
wget: option requires an argument -- o

All I'm looking for is to set up a cron to run the above task but now it's becoming a major operation lol.

Thanks :)
 

Infopro

Well-Known Member
May 20, 2003
17,076
521
613
Pennsylvania
cPanel Access Level
Root Administrator
Twitter
I'm not sure but it sounds to me like you've got this wrong somehow. WGET command is probably not the correct command to be using. The task scheduler file should probably be on your server, not pulled from another.

I'm sorry I can't help more than that, this command looks wrong to me. Hopefully someone else here can help, but I'd go back to the script developers first.
 

Brightonian

Member
Mar 17, 2011
10
0
51
Thanks Infopro,

I was just following the instructions from the /http://demo.worksforweb.com/iRealty/doc/UserManual/
 

Brightonian

Member
Mar 17, 2011
10
0
51
Can someone have the decency to explain why my previous post was removed :mad:
It is important to the resolution of this problem as it shows details of the cron :confused:
 

Infopro

Well-Known Member
May 20, 2003
17,076
521
613
Pennsylvania
cPanel Access Level
Root Administrator
Twitter
The CRON runs the task_scheduler.php which monitors all notifications.

You can configure the cron task as follows:

wget -q 'http://www.site.com/system/miscellaneous/task_scheduler/' -o - > /dev/null

In accordance with these settings the cron downloader will not create any files.

If you need an assistance with setting up a cron task, please consult you hosting support or Cpanel's manual.
In that it shows site.com, not their site, a site. I think. Meaning this script is to run from your own server. I'd have to read more of the docs and installation to help there but no time for that today.

I apologize but this might be better taken up with your host, or support for the script. You should go over your installation again and check the docs more to be sure you've got this all setup correctly.

Setup and configuration of a script (not cPanel) is a bit outside of the scope of these forums.
 

Brightonian

Member
Mar 17, 2011
10
0
51
Exactly Infopro.
That's why the cron job is wget -q 'http://www.cancasa.com/system/miscellaneous/task_scheduler/' -o - > /dev/null

It has my url inserted correctly and just needs to work correctly but CPanel is not accepting it and keeps on returning an AJAX error as mentioned in very first post.

All the relevant files are on the server so no reason why it shouldn't work.

I've attached a snapshot of the user manual instructions for the cron as the link provided previously is not opening the correct page.

Hope you understand my situation now.

Thanks
 

Attachments

Last edited:

Infopro

Well-Known Member
May 20, 2003
17,076
521
613
Pennsylvania
cPanel Access Level
Root Administrator
Twitter
Well, I quoted the cron doc just above, image shouldn't be needed. ;)

OK, lets try this then. Assuming the account you're setting this up on can use WGET, try editing the cron to something along these lines:

php -q -f /home/yourusername/public_html/system/miscellaneous/task_scheduler/index.php /home/yourusername/public_html/system/miscellaneous/task_scheduler/
This assumes there is a php file named index.php in that directory. If not you've have to sort that out.
 

Brightonian

Member
Mar 17, 2011
10
0
51
Hi Infopro, sorry no offence intended by posting the image, just thought it was easier for other potential helpers.

Just some background info here, I recently deleted the cron because it kept on dumping loads of index.html files in the home directory so I would presume that meant the command was working.
If I could now only get it to accept a new cron without giving Ajax errors, I might be able to figure it out but it still isn't allowing me to add a new cron.

I'm going to give your command above a try and see if it is accepted in my cpanel.

Thanks

UPDATE

I inserted the command you gave me with my username inserted and the system accepted it.
Don't know how to check if it's working but I guess I'll have to wait until it reaches the schedules time and hope to receive an email showing no errors.

Index.php file DOES exist in that folder so I think you may have cracked it. Just the waiting now.

Great stuff sir.

Thanks
 
Last edited:

Brightonian

Member
Mar 17, 2011
10
0
51
Got the following message from the cron when it was run on schedule:

"No input file specified"

Really don't know what else to try so if anyone has any ideas, I'd be grateful.

Thanks.
 

cPanelTristan

Quality Assurance Analyst
Staff member
Oct 2, 2010
7,607
41
348
somewhere over the rainbow
cPanel Access Level
Root Administrator
Change the command to the following:

Code:
php -q -f /home/yourusername/public_html/system/miscellaneous/task_scheduler/index.php
I see no reason at all that you would have two folder paths for this cron. What is the purpose of the cron again? Do you have documentation on using the cron in a how-to for whatever script is being used for us to review?
 

Brightonian

Member
Mar 17, 2011
10
0
51
Change the command to the following:

Code:
php -q -f /home/yourusername/public_html/system/miscellaneous/task_scheduler/index.php
I see no reason at all that you would have two folder paths for this cron. What is the purpose of the cron again? Do you have documentation on using the cron in a how-to for whatever script is being used for us to review?
Hi Tristan

Not very good at this m trying my best.
The cron runs with a script on my site for property listings by owners which was in set up when purchased and I think it works with notifications and the expiration of listed properties.
The only documentation I have is as shown in attached image.
I saw an index.php file for the script in the cpanel but not sure what it's supposed to contain if the cron is to work correctly.

I'll insert the command you gave above and see if it works but the original command the script writers gave me is as follows:

wget -q 'http://www.cancasa.com/system/miscellaneous/task_scheduler/' -o - >
/dev/null

I even tried to insert this command again a second ago and it still returned an Ajax error but strangely it was inserted when script was installed with no error but the reason I removed it was to stop index.html files being dumped in the home directory.
Now that I want to reinsert it, seems like it's no longer accepting it but I will try your command now and pray tat it resolves it.

Many thanks.
 

Attachments

Brightonian

Member
Mar 17, 2011
10
0
51
After doing some thorough checking of the directories, I found that the path the script writers give in the manual is incorrect.
The actual path of the file in question is:

/public_html/system/user-scripts/miscellaneous/task_scheduler.php

It seems they missed out the "user-scripts" part of the path. :(

Apologies about this but as mentioned earlier, I'm not a programmer, just trying my best. :eek:

I've attached the details of the tasks from the php file in text form to give an idea of what the cron is used for.

Does this mean I just add the user-scripts part to the above code or do I need something different?

Apologies for all these questions but I'm just a tad confused. :)

Thanks
 

Attachments