CodeIgniter Forums
HMVC Cron - Printable Version

+- CodeIgniter Forums (
+-- Forum: Using CodeIgniter (
+--- Forum: General Help (
+--- Thread: HMVC Cron (/showthread.php?tid=74872)

HMVC Cron - menilanjan - 11-19-2019

I am using codeigniter HMVC for my project. I have set a function named with "updateCustomer".  Everyday 5am this file will be run.
File path is application/modules/cron/controllers/Cron.php.
How will I set cron job for HMVC architecture? Please suggest

RE: HMVC Cron - HeyDarling - 11-25-2019

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


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.

import schedule, requests

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

print ('Waiting to start......')
while True: