Results 1 to 5 of 5
  1. #1
    Join Date
    Jan 2013
    Posts
    45
    Plugin Contributions
    0

    Default 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!

  2. #2
    Join Date
    Jan 2007
    Location
    Australia
    Posts
    6,167
    Plugin Contributions
    7

    Default Re: How to run script from admin as CRON

    Quote Originally Posted by DarkMen View Post
    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

  3. #3
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    13,393
    Plugin Contributions
    94

    Default 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.

  4. #4
    Join Date
    Jan 2013
    Posts
    45
    Plugin Contributions
    0

    Default Re: How to run script from admin as CRON

    Quote Originally Posted by RodG View Post
    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

  5. #5
    Join Date
    Jan 2007
    Location
    Australia
    Posts
    6,167
    Plugin Contributions
    7

    Default Re: How to run script from admin as CRON

    Quote Originally Posted by DarkMen View Post
    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

 

 

Similar Threads

  1. v151 How do I write up an SQL query to run from Admin Panel?
    By GumboStandards in forum General Questions
    Replies: 4
    Last Post: 28 Apr 2015, 03:44 PM
  2. Replies: 2
    Last Post: 9 Nov 2013, 07:09 AM
  3. Replies: 3
    Last Post: 25 Sep 2013, 10:11 PM
  4. Can I run Backup MYSQL Plugin v1.4 via cron job?
    By Renz in forum General Questions
    Replies: 2
    Last Post: 23 Mar 2012, 06:25 AM
  5. How to run a script upon purchase?
    By djex in forum General Questions
    Replies: 2
    Last Post: 6 Feb 2009, 05:26 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR