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.
|
||||
48
content/posts/un-peu-de-sobriete-energetique.fr.md
Normal file
48
content/posts/un-peu-de-sobriete-energetique.fr.md
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
+++
|
||||
date = '2025-11-03T09:31:57+01:00'
|
||||
draft = false
|
||||
tags = [ "homelab" ]
|
||||
title = 'Un peu de sobriete energetique'
|
||||
+++
|
||||
|
||||
J’aime bien quand les choses se font toutes seules.
|
||||
Mais avant d’arriver à une sauvegarde automatique, encore faut-il que la machine à sauvegarder soit réveillée.
|
||||
Et Pennsardin — ma grosse tour équipée d’un RAID 5 — a la fâcheuse tendance à dormir profondément.
|
||||
|
||||
Plutôt que de la laisser tourner 24h/24 pour “gagner du temps”, j’ai préféré miser sur la **sobriété énergétique**.
|
||||
Mon serveur principal reste allumé en permanence, mais les autres ne s’éveillent que quand c’est vraiment utile :
|
||||
ici, pour les sauvegardes nocturnes.
|
||||
|
||||
Un simple script Bash, un peu d’attente, et tout s’enchaîne tranquillement.
|
||||
|
||||
```bash
|
||||
#!/usr/bin/env bash
|
||||
|
||||
MAC="00:52:54:46:58:34"
|
||||
echo "[+] Réveil de Pennsardin via Wake-on-Lan"
|
||||
wakeonlan ${MAC}
|
||||
|
||||
echo "[+] Attente que Pennsardin soit joignable"
|
||||
until ping -c1 192.168.0.12 &>/dev/null; do
|
||||
sleep 1
|
||||
printf "."
|
||||
done
|
||||
echo -e "\n[+] Pennsardin en ligne"
|
||||
|
||||
echo "[+] Connexion à dunoz@pennsardin ..."
|
||||
exec ssh lomig@192.168.0.12
|
||||
```
|
||||
|
||||
Le principe est simple :
|
||||
|
||||
1. Un Wake-on-LAN pour sortir la machine de sa sieste.
|
||||
2. Une boucle qui attend le ping, histoire d’être sûr qu’elle a bien les yeux ouverts.
|
||||
3. Et enfin, une connexion SSH pour déclencher la sauvegarde.
|
||||
|
||||
Ce petit rituel résume bien la philosophie du homelab :
|
||||
automatiser sans gaspiller.
|
||||
On n’a pas besoin d’un cluster en éveil constant pour faire tourner trois sauvegardes et un blog — juste un peu d’organisation, de parcimonie et de bon sens.
|
||||
|
||||
La prochaine étape ?
|
||||
Planifier ce réveil via systemd et remettre Pennsardin en veille une fois la sauvegarde terminée.
|
||||
Un majordome numérique, économe et ponctuel.
|
||||
Loading…
Add table
Add a link
Reference in a new issue