Skip to content

inactivity_suspender - a quick ruby hack for suspending your home server

License

Notifications You must be signed in to change notification settings

scoopex/inactivity_suspender

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

inactivity_suspender

inactivity_suspender - a quick ruby hack for suspending your home server

I use my linux system at home to be:

  • a regular workstation
  • a media server
  • a file server

I wakeup the system by using "Wake On Lan" by using:

Therefore i do not want to automatically suspend it when a download is in progress, media i served to the local network of someone uses the fileserver. Typical linux suspend mechanisms do not care for network things.

I wrote this quick ruby hack as a workaround. (I love linux for having the possibility to write such a easy hack...)

What it does

  • Check if there is some network activity beyond a specified transferrate
  • Check if there is no mouse activity within a defined interval
  • Check is there currently not at least a specified number of disk operations are in progress for 10 seconds

If this is all true, suspend the system.

How to use it

  • Install the tool
cd /opt
git clone git@github.com:scoopex/inactivity_suspender.git
  • Put the following line to /etc/rc.local and add additional arguments if necessary
/usr/bin/screen -S inactivity_suspender -d -m  bash -c '/opt/inactivity_suspender/inactivity_suspender'
  • How to check whats going on
sudo bash
screen -x inactivity_suspender

TODO

  • Change ops to ops/10sec to ops/sec limit

About

inactivity_suspender - a quick ruby hack for suspending your home server

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages