Spaces:
Running
Running
Upload start-with-backup.sh with huggingface_hub
Browse files1234567891011121314151617181920212223242526#!/bin/sh# Startup wrapper: restore backup if needed, start periodic backup loop, then start Open WebUI.
set -eu
# 1. Restore if db doesn't exist/restore.sh
# 2. Start background backup loop (every hour, keeps last 24 snapshots)( BACKUP_INTERVAL="${BACKUP_INTERVAL_SECONDS:-3600}" echo "[start] Backup loop started — interval: \${BACKUP_INTERVAL}s" while true; do sleep "$BACKUP_INTERVAL" /backup.sh done) &
# 3. Run initial backup after 60s (so the db exists after open-webui starts)( sleep 60 /backup.sh) &
# 4. Start Open WebUI (exec so it becomes PID 1)exec ./start.shstart-with-backup.shAdded+26