Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/IsaiasCarrion/Homelab/llms.txt

Use this file to discover all available pages before exploring further.

The scripts/ directory contains three shell scripts that handle the most repetitive operational tasks in the homelab: backing up Docker volumes and Proxmox resources, cleaning up unused Docker objects, and keeping the host inventory files up to date. Running these regularly keeps the environment lean, documented, and recoverable.

Available Scripts

ScriptPurpose
backup.shAutomated backups of Docker volumes and Proxmox resources
prune_docker.shDocker resource cleanup — containers, images, networks, and volumes
update_hosts.shInventory update — regenerates the host list under inventory/

backup.sh

backup.sh automates the process of persisting stateful data from the homelab to the dedicated 1 TB HDD mounted at /mnt/hdd-backup. It targets both Docker volumes (the persistent data layer for running containers) and Proxmox-managed resources such as VM and LXC container backups. Running this script on a regular schedule ensures that a point-in-time recovery is always available without requiring any manual intervention. The backup destination is organized under /mnt/hdd-backup/docker/ with sub-directories for volumes, stacks, and other Docker artefacts, keeping each category of data clearly separated and easy to restore individually.
Before running backup.sh, confirm that /mnt/hdd-backup is mounted and accessible. The NFS share is shared between Proxmox and the Docker VM, so a mount failure will silently produce an empty or incomplete backup.

prune_docker.sh

Over time, Docker accumulates stopped containers, dangling images, orphaned networks, and unused volumes that consume disk space without serving any active workload. prune_docker.sh removes all of these in one pass, keeping the Docker VM’s filesystem from filling up between deployments. The script leverages Docker’s built-in prune subcommands:
# Remove all stopped containers, unused networks, dangling images, and build cache
docker system prune -f

# Remove all unused volumes (data not referenced by any container)
docker volume prune -f
Run this script periodically — or after tearing down a stack — to reclaim disk space and avoid resource exhaustion on the Docker VM.

update_hosts.sh

update_hosts.sh refreshes the host inventory files stored under inventory/. As new LXC containers or VMs are provisioned in Proxmox (or decommissioned), the inventory can drift out of sync with reality. This script brings inventory/hosts.md and related files back in line with the current state of the network, making the documentation an accurate reflection of what is actually running.

Scheduling with Cron

Schedule all three scripts with cron to achieve fully automated, hands-off maintenance. A weekly Docker cleanup and a nightly or weekly backup are sensible starting points for a homelab workload.
Add entries to the crontab on the Docker VM (edit with crontab -e). The schedule and absolute path to the scripts/ directory will vary depending on where the repository is cloned. The entries below are illustrative — adjust the timing and path to suit your environment:
# Illustrative example — adjust schedule and path to match your setup

# Run Docker cleanup (e.g. weekly)
0 2 * * 0 /path/to/homelab/scripts/prune_docker.sh >> /var/log/prune_docker.log 2>&1

# Run backup (e.g. nightly or weekly)
0 3 * * * /path/to/homelab/scripts/backup.sh >> /var/log/backup.log 2>&1

# Update host inventory (e.g. weekly)
0 4 * * 0 /path/to/homelab/scripts/update_hosts.sh >> /var/log/update_hosts.log 2>&1
Redirecting output to log files makes it easy to audit what each run did and to troubleshoot failures without having to run the scripts interactively.

Build docs developers (and LLMs) love