Spaces:
Paused
Paused
Download scripts/hermes-backup-loop.sh from Acrabohan/hermes-webui: direct link, hf CLI and curl.
- Browser
- Download file 850 Bytes
-
https://huggingface.co/spaces/Acrabohan/hermes-webui/resolve/main/scripts/hermes-backup-loop.sh
- Command line
-
hf download hf://spaces/Acrabohan/hermes-webui/scripts/hermes-backup-loop.sh
-
curl -L -o hermes-backup-loop.sh https://huggingface.co/spaces/Acrabohan/hermes-webui/resolve/main/scripts/hermes-backup-loop.sh
850 Bytes
| set -euo pipefail | |
| interval="${HERMES_BACKUP_INTERVAL_SECONDS:-1800}" | |
| initial_delay="${HERMES_BACKUP_INITIAL_DELAY_SECONDS:-300}" | |
| case "$interval" in | |
| ''|*[!0-9]*) | |
| echo "WARNING: invalid HERMES_BACKUP_INTERVAL_SECONDS=$interval; using 1800." | |
| interval=1800 | |
| ;; | |
| esac | |
| case "$initial_delay" in | |
| ''|*[!0-9]*) | |
| echo "WARNING: invalid HERMES_BACKUP_INITIAL_DELAY_SECONDS=$initial_delay; using 300." | |
| initial_delay=300 | |
| ;; | |
| esac | |
| echo "Hermes backup loop started. First backup in ${initial_delay}s, then every ${interval}s." | |
| if [[ "$initial_delay" != "0" ]]; then | |
| sleep "$initial_delay" | |
| fi | |
| while true; do | |
| echo "Running Hermes state backup at $(date -u +%Y-%m-%dT%H:%M:%SZ)." | |
| /usr/local/bin/hermes-state-backup backup || echo "WARNING: Hermes state backup failed; will retry later." | |
| sleep "$interval" | |
| done | |