fstrim-lxc/README.md
2025-10-31 15:40:45 +01:00

62 lines
2.2 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# fstrim-lxc Script
Kleines Host-Skript für **Proxmox VE**, das per `pct fstrim <VMID>` TRIM/Discard für **LXC-Container** ausführt.
Es unterstützt alle laufenden Container oder eine gezielte ID-Liste sowie einen interaktiven Modus.
## Voraussetzungen
- Proxmox VE Host (mit `pct`)
- Ausführung als `root`
- Container müssen **laufen** (gestoppte werden übersprungen)
## Aufruf
```bash
# Alle LXC-Container trimmen
./fstrim-lxc.sh --all
# Ausgewählte Container per ID-Liste (kommagetrennt)
./fstrim-lxc.sh -i 102,103
# Interaktiver Modus (Menü: alle oder IDs eingeben)
./fstrim-lxc.sh
```
## Beispiele
### Manuell
```bash
# Alle laufenden Container
bash ./fstrim-lxc.sh --all
# Nur bestimmte IDs
bash ./fstrim-lxc.sh -i 102,105,117
```
### Automatisierung (Cron)
Wöchentlich sonntags um 03:30 Uhr alle LXCs trimmen:
```cron
# /etc/crontab oder per crontab -e
30 3 * * 0 root /usr/bin/bash /root/scripts/fstrim-lxc.sh --all >> /var/log/fstrim-lxc.log 2>&1
```
## Hinweise
- Das Skript führt **keine** Containerstarts/-stops durch.
- TRIM wirkt hostseitig: Speicher wird am Storage-Backend (SSD / Thin-Provisioning) freigegeben.
## 💬 Support & Community
Du hast Fragen, brauchst Unterstützung bei der Einrichtung oder möchtest dich einfach mit anderen austauschen, die ähnliche Projekte betreiben? Dann schau gerne in unserer Techniverse Community vorbei:
👉 **Matrix-Raum:** [#community:techniverse.net](https://matrix.to/#/#community:techniverse.net)
Wir freuen uns auf deinen Besuch und helfen dir gerne weiter!
<p align="center">
<img src="https://assets.techniverse.net/f1/git/graphics/gray0-catonline.svg" alt="">
</p>
<p align="center">
<img src="https://assets.techniverse.net/f1/logos/small/license.png" alt="License" width="15" height="15"> <a href="./fstrim-lxc/src/branch/main/LICENSE">License</a> | <img src="https://assets.techniverse.net/f1/logos/small/matrix2.svg" alt="Matrix" width="15" height="15"> <a href="https://matrix.to/#/#community:techniverse.net">Matrix</a> | <img src="https://assets.techniverse.net/f1/logos/small/mastodon2.svg" alt="Matrix" width="15" height="15"> <a href="https://social.techniverse.net/@donnerwolke">Mastodon</a>
</p>