Download ASP/backup_postgres.sh from mahendra0120/Agentic_Serial-killer_Profiler: direct link, hf CLI and curl.
- Browser
- Download file 373 Bytes
-
https://huggingface.co/mahendra0120/Agentic_Serial-killer_Profiler/resolve/main/ASP/backup_postgres.sh
- Command line
-
hf download hf://mahendra0120/Agentic_Serial-killer_Profiler/ASP/backup_postgres.sh
-
curl -L -o backup_postgres.sh https://huggingface.co/mahendra0120/Agentic_Serial-killer_Profiler/resolve/main/ASP/backup_postgres.sh
373 Bytes
| set -euo pipefail | |
| PG_DB="asp" | |
| BACKUP_DIR="/workspace/pg-backups" | |
| BACKUP_FILE="${BACKUP_DIR}/latest.dump" | |
| mkdir -p "$BACKUP_DIR" | |
| if [ "$(id -u)" -eq 0 ]; then | |
| PGRUN="runuser -u postgres --" | |
| else | |
| PGRUN="sudo -u postgres" | |
| fi | |
| ${PGRUN} pg_dump -Fc "${PG_DB}" -f "${BACKUP_FILE}.tmp" | |
| mv "${BACKUP_FILE}.tmp" "$BACKUP_FILE" | |
| echo "✅ Backup written to ${BACKUP_FILE}" | |