Welcome Guest, Not a member yet? Register   Sign In
HMVC Cron
#2

You need someone or something to open the controller function via a HTTP request for this to work. In this case you just need to hit URL at

/Cron/updateCustomer

Making a script for this is super easy in python. Here is some code you can use to run it everyday at 5:00 (Server time). Untested so let me know if you encounter any errors.

Code:
import schedule, requests

URL = 'http://localhost/Cron/updateCustomer'
def Cronjob():
    try:
        BU = requests.session()
        result = BU.get(URL)
        print(result.content)
    except Exception as e:
        #oops we have an error
        print(e)

schedule.every().day.at("5:00").do(Cronjob)
print ('Waiting to start......')
while True:
    schedule.run_pending()
    time.sleep(10)
Reply


Messages In This Thread
HMVC Cron - by menilanjan - 11-19-2019, 01:16 AM
RE: HMVC Cron - by HeyDarling - 11-25-2019, 03:59 PM



Theme © iAndrew 2016 - Forum software by © MyBB