How can I have a simple bash script run during sleep? The script is pinging a machine on the network every 5 seconds, and if it is online, it will wake the computer from sleep. Is this possible on Ubuntu 18?

  • unix.stackexchange.com/tour
    – Michael D.
    Nov 24, 2019 at 23:32
  • I can't find out how to do it with that link
    – De 'Jaquis
    Nov 25, 2019 at 0:05
  • who is sleeping, who is awake? how does the awaken know the sleeper is asleep? how to ping a machine thats offline? And what have you tried so far?
    – Michael D.
    Nov 25, 2019 at 7:31

1 Answer 1


There is no way to execute anything on the OS level while a machine is put to sleep, this would kind defeat the purpose of having it asleep in the first place.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.