Skip to main content

Turn off your server when you sleep

Project description

Turn off your server when you sleep.

What it does

Give it some IPs, and it will call halt five minutes after the given computers have stopped pinging. Except if we are in the middle of the day or if we are disconnected from the internet (because we don’t want the computer to stop just because the network went off).

Install

The easiest way is to just grab the file marchanddesable.py.

If you want to install it, Marchanddesable is on pypi, so this should do the trick :

pip install marchanddesable

Arch users, you can install marchanddesable from AUR.

Usage

To halt the current machines 5 minutes after both 192.168.0.1 and 192.168.0.2 stop pinging, put this in your crontab. It will also log to the given file and rotate every night:

* * * * *       /usr/bin/marchand 192.168.0.1 192.168.0.2 -f /var/log/marchanddesable.log

If you don’t like cron, and think running daemon or programs in screen are better, you can use

marchand -l 192.168.0.1 192.168.0.2

TODO

These features may or may not be implemented at some point :

  • Play a sound to warn when the machines stopped pinging

  • A way to tell it not to halt the computer tonight without having to disable it

  • A way to change the rules without having to modify the script

If you want any of those, or anything else, give me a shout.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

marchanddesable-0.2.tar.gz (4.1 kB view details)

Uploaded Source

File details

Details for the file marchanddesable-0.2.tar.gz.

File metadata

File hashes

Hashes for marchanddesable-0.2.tar.gz
Algorithm Hash digest
SHA256 72fa7f3ecf8f4c41f7151ec8d1eedd27302e8621dce2f373defc5166536d573b
MD5 32984992b3ea58d33907aa1a25c647e1
BLAKE2b-256 59530495ab0bd856a454bc8bdb291675062da3daee41c8db0498dac45845e546

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page