How to run script from admin as CRON
Friends, does anybody know, how can I run task/script from admin or admin-folder as automatick task = CRON? I need to run xmlgenerators with CRON, but there I have a problem, that system can't do it. I think the problem is admin acces datas, but I do not know what to do with this.
Please for help, thank you very much!
Re: How to run script from admin as CRON
Quote:
Originally Posted by
DarkMen
Friends, does anybody know, how can I run task/script from admin or admin-folder as automatick task = CRON? I need to run xmlgenerators with CRON, but there I have a problem, that system can't do it. I think the problem is admin acces datas, but I do not know what to do with this.
Please for help, thank you very much!
Assuming you have cPanel, look under the advanced settings for 'cron jobs' . Select the frequency that you want the job to run (daily, weekly, monthly, etc) , then enter the command you want to run - must be a full path to the file , eg
"php <space> /home/public_html/zencart/admin/xmlgenerator.php
This assumes that the file to be run is indeed a php file, and that it has been uploaded to /home/public_html/zencart/admin/ and that its name is xmlgenerator.php
That's pretty much all there is to it.
Cheers
Rod
Re: How to run script from admin as CRON
You could follow the example provided by the /YOUR_ADMIN/currency_cron.php. That sets up an environment (removing the admin-access validation from the plugin's special "loader") where a cron-only PHP script can be successfully run.
Re: How to run script from admin as CRON
Quote:
Originally Posted by
RodG
Assuming you have cPanel, look under the advanced settings for 'cron jobs' . Select the frequency that you want the job to run (daily, weekly, monthly, etc) , then enter the command you want to run - must be a full path to the file , eg
"php <space> /home/public_html/zencart/admin/xmlgenerator.php
This assumes that the file to be run is indeed a php file, and that it has been uploaded to /home/public_html/zencart/admin/ and that its name is xmlgenerator.php
That's pretty much all there is to it.
Cheers
Rod
Yes, this I know, there is problem to run admin scripts, cause CRON ask for security login. Othere scripts, which are in other folder are without problems... Thanks
Re: How to run script from admin as CRON
Quote:
Originally Posted by
DarkMen
Yes, this I know, there is problem to run admin scripts, cause CRON ask for security login. Othere scripts, which are in other folder are without problems... Thanks
OK, first things 1st, CRON doesn't have a 'security login', in fact it is generally configured as a non-login account that is typically initially opened as the root user, and then chownd to the user account - Don't worry if this means nothing to you because unless you are the system admin of the server there is nothing you can do about any of this anyway, and since CRON is such an important service you can safely assume that it has been set up and configured correctly - in other words, "cron" is NOT your problem.
Please see lat9's response because that is where your problem is most likely to be found and fixed.
Providing us with a copy of the error messages would go a *long* way to helping solve the issue - I was about to say that this could be an ownership/permission problem with the file(s) but I assume you have reason to have mentioned 'security login' - and that points straight back to lat9's idea about the environment. (a file ownership/permissions issue would not create an error message that has anything about logins as that message implies the file to be executed by cron *has* actually been executed, but can't complete its task).
Cheers
RodG