Actualizar wiki: Redis con tmpfs, no requiere backup
@@ -4,11 +4,12 @@ Protege tus datos de NetBox con backups automáticos.
|
||||
|
||||
## Qué Hacer Backup
|
||||
|
||||
NetBox tiene 3 componentes críticos:
|
||||
NetBox tiene 2 componentes críticos:
|
||||
|
||||
1. **PostgreSQL** - Base de datos (lo más importante)
|
||||
2. **Configuración** - `/config/` (configuration.py, plugins, scripts)
|
||||
3. **Redis** - Solo caché temporal (opcional)
|
||||
|
||||
> ℹ️ **Redis no requiere backup**: Usa tmpfs (RAM) y solo almacena caché temporal que se regenera automáticamente.
|
||||
|
||||
---
|
||||
|
||||
@@ -37,16 +38,6 @@ docker run --rm -v netbox_config:/backup -v $(pwd):/target alpine tar czf /targe
|
||||
tar tzf netbox-config-20250101.tar.gz | head
|
||||
```
|
||||
|
||||
### Redis (Opcional)
|
||||
|
||||
```bash
|
||||
# Forzar guardado
|
||||
docker exec netbox-redis redis-cli --pass "TU_REDIS_PASSWORD" SAVE
|
||||
|
||||
# Backup del dump
|
||||
docker run --rm -v netbox_redis:/backup -v $(pwd):/target alpine tar czf /target/netbox-redis-$(date +%Y%m%d).tar.gz -C /backup .
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Backup Automático
|
||||
@@ -74,10 +65,6 @@ docker exec netbox-db pg_dump -U netbox netbox | gzip > $BACKUP_DIR/netbox-db-$D
|
||||
echo "Backing up configuration..."
|
||||
docker run --rm -v netbox_config:/backup -v $BACKUP_DIR:/target alpine tar czf /target/netbox-config-$DATE.tar.gz -C /backup .
|
||||
|
||||
# Redis (opcional)
|
||||
# docker exec netbox-redis redis-cli --pass "PASSWORD" SAVE
|
||||
# docker run --rm -v netbox_redis:/backup -v $BACKUP_DIR:/target alpine tar czf /target/netbox-redis-$DATE.tar.gz -C /backup .
|
||||
|
||||
# Limpiar backups antiguos
|
||||
echo "Cleaning old backups (older than $RETENTION_DAYS days)..."
|
||||
find $BACKUP_DIR -name "netbox-db-*.sql.gz" -mtime +$RETENTION_DAYS -delete
|
||||
|
||||
9
Home.md
9
Home.md
@@ -129,7 +129,14 @@ openssl rand -base64 32
|
||||
|
||||
- `netbox_config`: Configuración, media, scripts
|
||||
- `netbox_db`: Base de datos PostgreSQL
|
||||
- `netbox_redis`: Datos de Redis (caché)
|
||||
|
||||
### Redis (Caché en tmpfs)
|
||||
|
||||
Redis utiliza **tmpfs (RAM)** en lugar de volumen persistente:
|
||||
- ✅ **Más rápido**: Acceso directo a RAM
|
||||
- 🔒 **Contraseña requerida**: Seguridad defense-in-depth
|
||||
- ⚡ **No persistente**: Caché se regenera automáticamente
|
||||
- 💾 **No requiere backup**: Solo almacena sesiones y tareas temporales
|
||||
|
||||
---
|
||||
|
||||
|
||||
@@ -250,13 +250,10 @@ docker compose up -d netbox
|
||||
### Limpiar y Reiniciar
|
||||
|
||||
```bash
|
||||
# CUIDADO: Pierde caché y sesiones
|
||||
docker stop netbox netbox-redis
|
||||
docker rm netbox-redis
|
||||
docker volume rm netbox_redis
|
||||
docker compose up -d netbox-redis
|
||||
# Redis usa tmpfs - simplemente reiniciar el contenedor limpia la caché
|
||||
docker restart netbox-redis
|
||||
sleep 5
|
||||
docker start netbox
|
||||
docker restart netbox
|
||||
```
|
||||
|
||||
### Acceso de Emergencia a Django Shell
|
||||
|
||||
Reference in New Issue
Block a user