Page 1 of 2 12 LastLast
Results 1 to 10 of 11
  1. #1
    Join Date
    Oct 2007
    Posts
    25
    Plugin Contributions
    0

    Default Cron Jobs redirecting to login

    hello,

    I have the latest version of zen cart 1.3.8a.

    I have been struggling with my host to get a cron job going for the currency updater, but look to have the server doing what it is supposed to do now.

    However, the cron job appears to be failing.

    A confirmation email is sent with the source code for the login page?

    Is zen cart failing the cron job because it appears as though it is someone attempting to invoke the script who isnt logged in?

    HAs anyone got cron jobs working for the currency update function?

    ( i have looked at the add ons but want to try and figure out the cron issue first)

    Thanks

  2. #2
    Join Date
    Jan 2004
    Posts
    66,444
    Plugin Contributions
    279

    Default Re: Cron Jobs redirecting to login

    Quote Originally Posted by Frano View Post
    Is zen cart failing the cron job because it appears as though it is someone attempting to invoke the script who isnt logged in?
    Most likely, yes.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

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

    Default Re: Cron Jobs redirecting to login

    Quote Originally Posted by Frano View Post
    A confirmation email is sent with the source code for the login page?

    Is zen cart failing the cron job because it appears as though it is someone attempting to invoke the script who isnt logged in?
    Possible, but not something I've ever experienced.

    Wouldn't this pretty much defeat the purpose of a cronjob?

    Quote Originally Posted by Frano View Post
    HAs anyone got cron jobs working for the currency update function?
    Yes, on many different systems.

    There are about 2 important things you need to set/check.

    1. The full path to the store admin directory needs to be set in the currency_update.php file itself.

    2. The crontab command line needs to be entered as

    x x x x x php /file/path/to/currency_updater.php

    where 'php' is the progam to be run, and the path is the parameter.

    This example assumes the crontab is being edited by a user with the 'crontab -e' command. (or some other 'wrapper' program).

    If you are the sysadmin with root access and editing /etc/crontab directly the line will need to read like:

    x x x x x x root php /file/path/to/currency_updater.php

    Generally when setting this up for the first time on any given server I first test it by running "php /file/path/to/currency_updater.php" from the command line. Only when this is successful do I add it to the crontab itself. I then set it to run every minute, set one of the currencys to something it shouldn't be, wait a minute, and if the currency has corrected itself I declare all ok and set it to run once daily.

    Most problems I've experienced tend to be incorrect paths defined for the admin and program itself. On rare occasions I've needed to use the full pathname for the php executable (usually /usr/sbin/php), but this shows up on the command line tests.

    Cheers
    Rod

  4. #4
    Join Date
    Oct 2007
    Posts
    25
    Plugin Contributions
    0

    Default Re: Cron Jobs redirecting to login

    Thanks for the advice, I still cant get this cron job working however.

    I went back to my hosts and this was their reply:

    I checked and the error is because of the ?variables you are adding. This either has to be done through a GET url or through a different string in the cron. Please check with the programmer or vendor of the script and let me know how they tell you to add it

    Does that make sense to anyone?

    Thanks

    Francis

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

    Default Re: Cron Jobs redirecting to login

    Quote Originally Posted by Frano View Post
    Thanks for the advice, I still cant get this cron job working however.

    I went back to my hosts and this was their reply:

    I checked and the error is because of the ?variables you are adding. This either has to be done through a GET url or through a different string in the cron. Please check with the programmer or vendor of the script and let me know how they tell you to add it

    Does that make sense to anyone?

    Thanks

    Francis
    No, it doesn't make sense to me unless you are actually trying to add variables to the cron command line, which as per my earlier post should look something like:

    x x x x x php /file/path/to/currency_updater.php

    Perhaps if you could give a little more information, such as a copy of the cron command that you are actually using. Any other error messages. What you have tried to solve the problem, eg: Adding quotes to the command string, trying a different path ... eg ~/some/path/currency_updater.php (as opposed to /some/path/currency_updater.php).

    Another thing I'd be doing is adding something like

    echo "Hello World" ; exit ;

    near the top of currency_updater.php to check that cron is actually calling the program in the first place.

    There really are LOTS of things you can do to try to solve this problem. We can only offer suggestions, and only you can do the actual debugging and testing.

    Cheers
    Rod

  6. #6
    Join Date
    Oct 2007
    Posts
    25
    Plugin Contributions
    0

    Default Re: Cron Jobs redirecting to login

    Rod,

    Thanks for the advice I will keep looking and see what I can come up with.

    I dont have much experience with cron jobs but will act on your suggestions.

    I am sure I will be posting again soon!

    Thanks

  7. #7
    Join Date
    Oct 2007
    Posts
    25
    Plugin Contributions
    0

    Default Re: Cron Jobs redirecting to login

    I am back working on this issue.../

    can someone tell me where the currency_updater.php file is stored?

    I cant seem to find it anywhere?

    Thanks

    Frano

  8. #8
    Join Date
    Feb 2005
    Location
    Lansing, Michigan USA
    Posts
    20,021
    Plugin Contributions
    3

    Default Re: Cron Jobs redirecting to login

    It appears that when you install the mod, you decide where that file goes. The instructions say to place it outside the web-accessible parts of your store for security reasons.

  9. #9
    Join Date
    Oct 2007
    Posts
    25
    Plugin Contributions
    0

    Default Re: Cron Jobs redirecting to login

    Thanks for the reply.

    However, I havent installed the mod for this?

    I am just looking at using a cron to update the currencies instead of pressing the button in the admin?

    Frano

  10. #10
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,755
    Plugin Contributions
    9

    Default Re: Cron Jobs redirecting to login

    However, I havent installed the mod for this?

    I am just looking at using a cron to update the currencies instead of pressing the button in the admin?
    You can not cron a currency update directly in a cron tab.

    You need to cron the excexution of a file that updates the currencies

    Get the module
    http://www.zen-cart.com/index.php?ma...roducts_id=430
    Zen-Venom Get Bitten

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. Cron Jobs Help Need
    By LittleAngell52 in forum General Questions
    Replies: 5
    Last Post: 29 Jun 2016, 10:38 AM
  2. v154 Any good advice on adding PHP Cron Jobs?
    By SpaceMonkey in forum General Questions
    Replies: 19
    Last Post: 4 Dec 2015, 12:30 AM
  3. EasyPopulate Cron Jobs
    By darkmarauder in forum All Other Contributions/Addons
    Replies: 2
    Last Post: 23 Feb 2011, 05:40 PM
  4. A Question about Cron Jobs
    By LissaE in forum General Questions
    Replies: 0
    Last Post: 30 Jul 2009, 12:19 AM

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