Set cron on selective days

I have to set a Cron for Monday and Thursday only, Is that possible in scheduler events ?

Yes, it is possible to set a Cron job in to run only on specific days, such as Monday and Thursday, using the scheduler events.

For example, to schedule a task to run at 8:00 AM on Mondays and Thursdays, you can add the following in your hooks.py file:

scheduler_events = {
    "cron": {
        "0 8 * * 1,4": [
            "your_app_name.your_module_name.your_method_name"
        ]
    }
}
2 Likes

Thankyou for the reply. It is working.

Hi @NCP.

I was set up my cron by mistake like 20 33 * * 1,4

now in doctype my scheduled job type list list is not getting updated and not able to delete also.

While I changed in hooks and migration is done also, mail I am getting but in scheduled job doc type it is not getting updated and not able to delete.

Not able to open that one and delete.

Is there any solution?

You can stop it.

If you don’t have the right to delete, go to the Role Permission Manager and grant the necessary permissions.

Thank you it is working