Mejoras de sesion: estabilizacion, IA, Nexus Yonke y marketplace B2B
- F0 blindaje: Redis/Celery, pg_hba sin trust LAN, secretos a env 600, backups, webhook auth, jobs muertos - F1 caja: bugs POS, reembolsos al corte, apartados, CFDI, topes de descuento en cotizacion/apartado - F2/F7 IA de catalogo: autocategorizacion, dedup de SKUs con embeddings, OCR de facturas, descripciones, claves SAT, limpieza de fitment - F3 IA en el flujo: vision Yonke, preguntas MeLi, venta cruzada, anomalias, sinonimos, busqueda semantica (rerank/embeddings) - F4/F8 escala y cartera: /metrics+Prometheus+Grafana, pool, score de credito, churn, metricas multi-tenant - Nexus Yonke (M1-M6): modelo de datos 1-de-1, alta por donador, vitrina publica, MeLi usado, consignacion, garantia por dias, reportes, etiquetas - Marketplace B2B entre yonkes (catalogo + pedidos cross-tenant) - Seguridad: auth en /api/admin/* (35 endpoints), alertas por tenant - Migraciones v4.27/v4.28; timers expire-demos y rollup-metrics
This commit is contained in:
@@ -31,6 +31,18 @@ log() {
|
||||
echo "[$(date '+%Y-%m-%d %H:%M:%S')] $*"
|
||||
}
|
||||
|
||||
# ─── Cleanup old backups (FIRST, so a full disk cannot block it) ───
|
||||
log "Cleaning up backups older than $RETENTION_DAYS days ..."
|
||||
if [[ "$DRY_RUN" == true ]]; then
|
||||
log "DRY-RUN: would delete backups older than $RETENTION_DAYS days"
|
||||
else
|
||||
find "$BACKUP_DIR" -name "nexus_backup_*.tar.gz" -type f -mtime +$RETENTION_DAYS -delete
|
||||
find "$BACKUP_DIR" -name "nexus_backup_*.sql" -type f -mtime +$RETENTION_DAYS -delete
|
||||
# Remove empty leftovers from failed runs (e.g. 0-byte dumps when disk was full)
|
||||
find "$BACKUP_DIR" -name "nexus_backup_*" -type f -empty -delete
|
||||
log "Cleanup complete. Disk usage: $(df -h / | awk 'NR==2{print $3"/"$2" ("$5")"}')"
|
||||
fi
|
||||
|
||||
# ─── PostgreSQL dump ───
|
||||
log "Dumping PostgreSQL database: $DB_NAME ..."
|
||||
DUMP_FILE="${BACKUP_DIR}/${BACKUP_NAME}.sql"
|
||||
@@ -90,14 +102,6 @@ else
|
||||
log "INFO: S3_BUCKET not set. Skipping cloud upload."
|
||||
fi
|
||||
|
||||
# ─── Cleanup old backups ───
|
||||
log "Cleaning up backups older than $RETENTION_DAYS days ..."
|
||||
if [[ "$DRY_RUN" == true ]]; then
|
||||
log "DRY-RUN: would delete backups older than $RETENTION_DAYS days"
|
||||
else
|
||||
find "$BACKUP_DIR" -name "nexus_backup_*.tar.gz" -type f -mtime +$RETENTION_DAYS -delete
|
||||
find "$BACKUP_DIR" -name "nexus_backup_*.sql" -type f -mtime +$RETENTION_DAYS -delete
|
||||
log "Cleanup complete."
|
||||
fi
|
||||
|
||||
# ─── Cleanup ───
|
||||
log "Post-backup cleanup (already done at start)."
|
||||
log "Done."
|
||||
|
||||
Reference in New Issue
Block a user