Jump to content
xisto Community
Sign in to follow this  
rpgsearcherz

Cron Jobs How to Set Them Up

Recommended Posts

Hey guys, hoping someone can help out with this. Basically I just want to set up a cron job on my server (using Xisto - Web Hosting).Based on what I was reading, we should be adding a script like the following:/home/(AccountName)/public_html/CronScript.phpIn the above case, I used the settings above the "script" box to set up the time frame. I have tried hour, 30-minutes and 1-minute. None of these seem to work.Is there something I'm missing with this? I'm completely new to cron jobs.Thanks all!

Share this post


Link to post
Share on other sites

LOL, you may be new to cron jobs, but at least you know what one is! I don't even have a clue as to what you are talking about. I sure wish I was smarter about computer stuff. After all these years of fighting Front Page and making my own web site, I still have problems with it.

Share this post


Link to post
Share on other sites

If I'm understanding it right, it's pretty much just a method of automatically running a script at set intervals. For example, the credit script here (for MyCents) is run at every x amount of time, so a Cron Job is set up that points to the script that calculates/allocates the MyCents. Once the script is run, it's updated.At the same time, Opaque could also manually run the script (via address/.../script.php), but the point of the Cron Job is to automate it.In my case, I am syndicating articles from multiple sites of mine on to one main domain. To do this, I have a script that I can run manually (by visiting the address) but it would be more beneficial if I could just let the main domain sit and have it bring in the new article names by itself.Hope that helps clear it up for you!

Edited by rpgsearcherz (see edit history)

Share this post


Link to post
Share on other sites

OK then, rpgsearcherz,

 

let's see if we can help you sot this out.

 

First of all, do you get an email to tell you a Cron Job has been executed (or even, to tell you a Cron Job has failed)?

 

(Although it is possible to let the Cron Job being executed without any notification).

 

 

However, the way you try to go about it, you are almost on the right track, you said:

 

Based on what I was reading, we should be adding a script like the following:

/home/(AccountName)/public_html/CronScript.php


So, you are almost right there, namely:

 

Go into your Control panel

Under Advanced, click "Cron Jobs"

On the screen that then opens you will see a window "Add new Cron Job"

In "Common Settings", set how often you want the Cron job to be executed

Underneath that, you can set, using the drop-downs, at which time you want the Cron Job to run

Then, in the field next to "Command", you enter your "/home/(AccountName)/public_html/CronScript.php" (without the quotations, and preceded by "php -q", again without the quotations.


The whole thing would then look like "php -q /home/(AccountName)/public_html/CronScript.php", and the you click "Add new Cron Job".

 

Then, below, your Cron Job should appear with all the chosen parameters.

 

It would be a good thing to select the option to be notified via e-mail when your Cron Job runs, you will then also be notified in case your Cron Job causes errors, which is helpful too.

 

You select that option just by entering the email address you want to receive the notifications in in the field above where you enter the settings for your Cron Job.

 

Give it a try, and if you get errors, just report back so you can receive further help if needed.

 

Good luck.

Hope that helps.

Share this post


Link to post
Share on other sites

Thank you for the response! Based on what I can tell, that's exactly how I had it set up (aside from the preceeding php -q). I've gone ahead and screenshotted the screen for you so you can see what I do.

 

I do have it set to email me as well (at the top) and it has my email address in bold. Note that I removed my username (after Home) here -- that should be our main one, right? Like the one we see in our Xisto - Web Hosting login screen listed with the password beside it for Cpanel?

 

Posted Image

 

Edit: Also, I get no emails from the system. I've tried setting it to a couple different ones and none get pinged to let me know it succeeded/failed, so it leads me to believe the system isn't even trying.

Edited by rpgsearcherz (see edit history)

Share this post


Link to post
Share on other sites

OK,this looks right to me, and, yes, where you have blanked the bit out should be your account name.Anyway, now, regarding the script:See if it makes any difference removing the "-q" after php, so just "php /home/***/public_html/etc.".Also, the cron scripts you run, did you write them yourself or did you get them from somewhere.Make sure they work properly too.If you still have no joy, just get back to me.

Share this post


Link to post
Share on other sites

Just tried what you said, and still no luck. As for the script, it was pre-written and most people seem to have no issues with it.Maybe it has to do with the starting part of it though? It starts with:#!/usr/bin/phpIs our location possibly different than that? That's the first line of the file, although I can post the rest if needed as well.Edit: Based on what I'm reading, it could have to do with the wrong php address. They say the default should be /usr/... but I see no folder called "usr" at the root directory. I think that may be the issue and would explain why CPanel refuses to even send a message letting me know it's failing.Edit2: Through more reading it appears Cron may not even be running. It should be sending an email regardless of what the error is to let me know -- for example, letting me know that it's got the wrong address/file type/etc. I get absolutely nothing. I've tried with a Gmail address, Yahoo, MSN and even my domain's. Nothing gets an email. I've checked spam/trash as well with no luck.Edit3: Looking through the packages, with the Logic PRO plan it specifically states it supports Cron, whereas the Logic (the $1.95) one doesn't. I'm wondering if maybe that's the underlying issue.Kind of sucks that I spent many hours trying to figure this out and then find out I may have had it right all along and it was just the disabled system holding me back, :P.

Edited by rpgsearcherz (see edit history)

Share this post


Link to post
Share on other sites

As far as I know, the "/usr/" bit should be a reference to the one you hid (usr=short for "user"), so maybe that is actually trying to refer to your account name.

You say the Logic plan ($1.95) does not support Cron Jobs?
Are you quite sure?
It did when I was on it (although I am on Logic pro now), but it definitely DID support Cron Jobs in the past.

In that case, the best thing to do is to raise a ticket here, and first of all check whether or not the Logic Plan (I assume that is the one you are on) does support Cron Jobs, and then explain the rest of your problem.

You will definitely get further help from the staff at Xisto, but it might be a good idea to quote the text of your PHP script that controls the Cron Job too.

Just out of interest, could you be so kind, after you get a reply to your support ticket, whether or not the Logic plan supports Cron Jobs?

I am really curious now, as, like I mentioned before, they worked perfectly when I was on the Logic Plan.

Share this post


Link to post
Share on other sites

As far as I know, the "/usr/" bit should be a reference to the one you hid (usr=short for "user"), so maybe that is actually trying to refer to your account name.
You say the Logic plan ($1.95) does not support Cron Jobs?
Are you quite sure?
It did when I was on it (although I am on Logic pro now), but it definitely DID support Cron Jobs in the past.

In that case, the best thing to do is to raise a ticket here, and first of all check whether or not the Logic Plan (I assume that is the one you are on) does support Cron Jobs, and then explain the rest of your problem.

You will definitely get further help from the staff at Xisto, but it might be a good idea to quote the text of your PHP script that controls the Cron Job too.

Just out of interest, could you be so kind, after you get a reply to your support ticket, whether or not the Logic plan supports Cron Jobs?

I am really curious now, as, like I mentioned before, they worked perfectly when I was on the Logic Plan.


I sent a ticket in yesterday and already got a reply. It does support Cron jobs and apparently there is an issue with the script (which should still send out emails to let me know it failed...). And it's not the script itself that's the issue -- after spending a few hours searching for information on the error that was sent to me by Xisto, I found that it's actually an issue with all Cron jobs in Joomla 1.6 and 1.7 that has still yet to be resolved.

So Logic *does* get Cron jobs, it's just an issue with the CMS I'm using.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.