How to run custom python script on bench start?

I have a custom python script that I’d like to be run every time I restart the server with bench start. Is there any way to do this?

For development setup, make it part of your Procfile

For production add it to supervisor config.

optional: make it into custom bench command instead of just running it as script. it’ll behave like other bench commands from procfile/supervisor

2 Likes