About Cron Job setup

Discussion in 'Installation' started by hbf1000, Jul 30, 2008.

  1. hbf1000

    hbf1000 New Member

    Joined:
    Jul 17, 2008
    Messages:
    8
    Hello everybody,
    In aMember manual says that cron.php should run on a hourly basis.
    But my hosting only support daily setup.
    My question is: is it really necessary to setup this cron hourly ? Or daily is already sufficient.

    Thank you,
    Herbert.
  2. skippybosco

    skippybosco CGI-Central Partner Staff Member

    Joined:
    Aug 22, 2006
    Messages:
    2,526
    Depends on what payment type you are using, subscription or one time payments, whether or not you are using affiliate, etc.

    I use PayPal and Authorize.net, one time payments, no affiliate. I run my cron on a daily basis.
  3. davidm1

    davidm1 aMember User & Partner

    Joined:
    May 16, 2006
    Messages:
    4,437
    I have always run daily too. Might hourly cause sequenced email to be sent out multiple times?

    David
  4. jimjwright

    jimjwright New Member

    Joined:
    Sep 12, 2007
    Messages:
    162
    Hello,

    I believe CCBill is the only payment processor that requires more than once a day. If you have recurring subscriptions then when using CCBill as payment processor, CCBill will rebill the subscription. On initial signup aMember will set the expiration date of subscription to next billing cycle. CCBill has what is known as a datalink connection that can be queried for expired/renewed subscriptions. This mechanism via aMember's cron.php is used by aMember to query for any subscriptions that have expired on renewed. I believe CCBill only reports subscriptions that have expired/renewed on that calendar day. It is thru cron.php and datalink connection to CCBill that aMember is able to properly update the payment record to deny access or move the expiration forward to the next billing cycle date. I believe the reason for doing it hourly or more than once a day is to have some reduncy in case a path to the network is down so that if the query to CCBill fails it can be tried again. Its not clear from documentation what happens if your website or network is down longer than 24 hours if when you come up whether or not CCBill reports expired or renewed subscriptions that had not be reported. As part of the query you pass the startdate and enddate of subscriptions you are interested in so hopefully CCBill will report them. If it does then it would seem once a day would be sufficient, if it doesn't then you would have to manually update payment records.

    aMember plugins register with aMember plugin architecture how often they need to be called. The CCBill payment processor registers for hourly. All other plugins register for daily, including the internal aMember stuff that does email stuff. aMember has code to make sure that plugins they require daily are only called once for that day. So if you set up cron to go hourly then only plugins they require hourly notification will be called at that frequency all others would only be called once in a 24 hour period.

    Jimmy
  5. calisolllc

    calisolllc Member

    Joined:
    Feb 19, 2007
    Messages:
    194
    If your host allows no cron to be run more than once per day and you need once per hr for ccBill then simply set up 24 crons. One for 1am, next for 2am etc
  6. skippybosco

    skippybosco CGI-Central Partner Staff Member

    Joined:
    Aug 22, 2006
    Messages:
    2,526
    now that is just genius..
  7. calisolllc

    calisolllc Member

    Joined:
    Feb 19, 2007
    Messages:
    194
    If you have a REALLY strict hosting service who ruthlessly enforce the cron thing and you really want to get devious then make 23 copies of cron.php with different names and set up the crons, 1 each for each renamed copies of cron.
    Run Aron.php at 1am
    run Bron.php at 2am
    run Cron.php at 3am
    ....all the way to...
    run Xron.php at midnight.
  8. hbf1000

    hbf1000 New Member

    Joined:
    Jul 17, 2008
    Messages:
    8
    I use Paypal, subscription (monthly) and will have affiliate. In this case, can a run cron daily ?

    Tks.
  9. davidm1

    davidm1 aMember User & Partner

    Joined:
    May 16, 2006
    Messages:
    4,437
    Yeah, you're gonna want to run it daily so your email sequence gets sent out on time.

    David
  10. hbf1000

    hbf1000 New Member

    Joined:
    Jul 17, 2008
    Messages:
    8
    David, what do you mean by email sequence ? Auto-responder ?
  11. davidm1

    davidm1 aMember User & Partner

    Joined:
    May 16, 2006
    Messages:
    4,437
    Yep, if you have auto responder sequence set for a product, or when the product expires etc.

    David

Share This Page