Score:1

How to ensure execution of time consuming task on reboot/shutdown?

cn flag

I have a bash script that is supposed to execute on reboot/shutdown of a remote Ubuntu server, connected over SSH:

ls /etc/rc{0,6}.d/k99*
/etc/rc0.d/k99_stop_all  /etc/rc6.d/k99_stop_all

The script needs about 3 min to finish.

How can I ensure the reboot/shutdown only happens on successful execution of k99_stop_all?

Does sudo shutdown -r 10 starts execution of the script scheduled for reboot?

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.