Automatically running jupyter notebooks and persisting memory


Every sunday, after my workstation is reboot, I have to manually toggle to multiple jupyter notebooks and run them so that I can have the work persisted in memory for the week. I am interested in automating this process. Everything i’ve read up until now (papermill, using nbconvert in api or nbconvert command line + cron, jupyter scheduler) seems to do the same thing in the backend, which is locally run a notebook and copy its output to some new file (or replace the original file).

I start my jupyter server via cron. I would like some way to specify some notebooks and do the equivalent of “restart kernel and run all”, exiting at the first error.

How can I do this?

You can use the api to start the server: JupyterHub REST API — JupyterHub documentation (or you can hit /hub/spawn directly)

But I don’t know how to run a notebook so that you can access it later. It probably depends on your spawner.