I have a headless server running Ubuntu Server Edition 14.04.

I have tested pm-suspend-hybrid and it works. I am able to manually put the server into suspend-hybrid through command line.

I am also successfully able to resume the server through WoL from another machine.

What I would like to do is get the server to automatically go into suspend-hybrid when not in use for at least 30 mins.

By use I mean:

  • remote machines are accessing NFS shares on the server over the network
  • my TV is accessing DLNA content over the network

If it is too complicated to determine when a machine is idle, alternatively I would like to set the server to go into suspend-hybrid from 01:00 AM every day.

Is there any tutorial or step by step process I can use to get this working?

  • 1
    Run man crontab and look at the syntax there to put your command to run at 1am. – Daniel Jun 15 '15 at 20:43
  • Welcome to Ask Ubuntu! ;-) What I would to is put the DLNA and NFS log level to info, then parse the logs and see whether there was no activity for 30 minutes and then use pm-suspend-hybrid. (I would run the script every 5 minutes using cron. – Fabby Jun 15 '15 at 23:20

Adding on to what @Daniel said:

The following will make the computer pm-suspend-hybrid every day at 1 A.M.:

0 1 * * * pm-suspend-hybrid >/dev/null 2>&1

Add this line to your crontab (You can access your crontab by running sudo crontab -e)

  • Thanks very much this worked. I had to amend the command slightly to get it working by pointing it to the location of pm-suspend-hybrid. – BrokenCode Jun 17 '15 at 19:45
  • You're welcome! Glad I could help :) – Grammargeek Jun 17 '15 at 20:14

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.