0

I am working on a small project and would like to know if there is a way to execute a function/script if the server is about to shutdown, and if there is a way to hold it for a bit to complete the operations? Thanks!

Edit: I need this to work on a Ubuntu server.

Andrey
  • 68
  • 2
  • 9
  • 1
    there probably is a way, but it would depend on the server and the OS – jsotola Jul 03 '20 at 18:32
  • 1
    This answer and implementation example is exactly what you want to do if you have a Linux server. [Python detect linux shutdown and run a command before shutting down](https://stackoverflow.com/a/39275997/8840245) – Mrinal Roy Jul 03 '20 at 18:39

0 Answers0