OK, so now to describe the behaviour, historical method of managing this and why Im asking for advice.
I run a site whose purpose is to provide redirects for resources in a retired library catalogue system. Some years ago the catalogue admin exported direct links for each legacy catalogue resource and the corresponding direct link to the each resource in the new catalogue system.
We have been using nginx to ensure our visitors and partners with links to old resources can still access the resource they are interested in by redirecting (with permanently moved HTTP header for web indexers to update their data) to the resource they want in the new catalogue.
This resulted in the site's config including very large lists of redirects via include files. The web server handles this just fine but understandably Certbot takes so longer parsing the site config that it does not get around to requesting the certificate.
On older hosts I worked around this by running certbot renew in a cronjob preceded by a script to temporarily remove the redirect include files from the site's config, run the renewal, then update the site config with the include files again. Worked just fine.
On moving to Ubuntu 24.04, I understand that the renewal is scheduled automatically by the Certbot snap, in some part to help reduce the load on the LE servers by randomising the time the renewal runs.
This is fine and I tried to work within this approach and have my scripts run using renewal pre- and post-hooks.
What I have found in troubleshooting is that the pre-hook is not run until Certbot has parsed the site config so the large redirect includes remain in the site config and Certbot times out.
Now as a temporary workaround, I can manually run the pre-hook script and then run certbot renew. This works fine. Certbot can parse the modified site config, it runs the pre-hook script (which is superfluous but does no harm), renews the certificate and then runs the pos-hook script.
This is fine to get the host properly configured and ensure all the certs are up to date initially but the scheduled renewal is still going to run and time out.
I can obviously create a cronjob similar to that on my old server to process the renewal but this will run at a fixed time and will not stop the other Certbot-scheduled renewal attempt from running as well. From my reading even if I'm able to disable the Certbot schedule it will be recreated with any updates to Certbot.
Sorry for the essay.
Thank you for any ideas or recommendations.