Add: un peu de sobriété énergétique
This commit is contained in:
parent
d9c910ddb8
commit
5470d4006d
2 changed files with 96 additions and 0 deletions
48
content/posts/un-peu-de-sobriete-energetique.en.md
Normal file
48
content/posts/un-peu-de-sobriete-energetique.en.md
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
+++
|
||||
date = '2025-11-03T09:31:57+01:00'
|
||||
draft = false
|
||||
tags = [ "homelab" ]
|
||||
title = 'A little energy-conciousness'
|
||||
+++
|
||||
|
||||
I like when things take care of themselves.
|
||||
But before you can automate backups, the machine to be backed up has to be awake.
|
||||
Pennsardin — my big desktop tower running a RAID 5 array — has an annoying tendency to sleep deeply.
|
||||
|
||||
Instead of leaving it powered on 24/7 just “for convenience,” I chose **energy sobriety**.
|
||||
My main server stays on, but the others only wake up when they actually have work to do —
|
||||
in this case, during nightly backups.
|
||||
|
||||
A short Bash script, a bit of patience, and the process flows naturally.
|
||||
|
||||
```bash
|
||||
#!/usr/bin/env bash
|
||||
|
||||
MAC="00:52:54:46:58:34"
|
||||
echo "[+] Waking up Pennsardin via Wake-on-LAN"
|
||||
wakeonlan ${MAC}
|
||||
|
||||
echo "[+] Waiting for Pennsardin to respond"
|
||||
until ping -c1 192.168.0.12 &>/dev/null; do
|
||||
sleep 1
|
||||
printf "."
|
||||
done
|
||||
echo -e "\n[+] Pennsardin is online"
|
||||
|
||||
echo "[+] Connecting to lomig@pennsardin ..."
|
||||
exec ssh lomig@192.168.0.12
|
||||
```
|
||||
|
||||
Here’s the idea:
|
||||
|
||||
1. A Wake-on-LAN packet brings the system out of its nap.
|
||||
2. A simple loop waits for the first ping reply — making sure the machine is really awake.
|
||||
3. Finally, an SSH connection triggers the backup sequence.
|
||||
|
||||
This little ritual sums up my homelab philosophy perfectly:
|
||||
automate without wasting.
|
||||
You don’t need an always-on cluster to handle a few backups and a blog — just a bit of organization, restraint, and common sense.
|
||||
|
||||
Next step?
|
||||
Scheduling this wake-up via systemd, and letting Pennsardin go back to sleep once the backup is done.
|
||||
A digital butler — punctual and energy-conscious.
|
||||
Loading…
Add table
Add a link
Reference in a new issue