Files
gaokao-volunteer-system/ops/cron/gaokao-backup.crontab.example
Hermes Agent 246f21c7f2
Some checks failed
CI / pytest (Python 3.10) (push) Has been cancelled
CI / pytest (Python 3.11) (push) Has been cancelled
CI / pytest (Python 3.12) (push) Has been cancelled
feat(review): land unified remediation and rules evidence closure
2026-06-18 10:21:38 +08:00

21 lines
1.1 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 安装前请替换仓库路径、日志路径和备份根目录。
SHELL=/bin/bash
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
GAOKAO_BACKUP_ROOT=/var/backups/gaokao
GAOKAO_BACKUP_KEEP=7
GAOKAO_DB_PATH=/var/lib/gaokao/admin.db
GAOKAO_ORDERS_DB_PATH=/var/lib/gaokao/orders.db
GAOKAO_SHARE_DB_PATH=/var/lib/gaokao/share/short_links.db
GAOKAO_SHARE_REPORT_DIR=/var/lib/gaokao/share/reports
GAOKAO_PORTAL_UPLOAD_DIR=/var/lib/gaokao/portal_uploads
GAOKAO_BACKUP_ENV_FILE=/etc/gaokao/.env
GAOKAO_BACKUP_CONFIG_DIR=/etc/gaokao
GAOKAO_BACKUP_SECRETS_DIR=/var/lib/gaokao/secrets
# 每天 02:30 生成一份目录快照
30 2 * * * cd /srv/gaokao-volunteer-system && bash scripts/backup_snapshot.sh >> /var/log/gaokao-backup.log 2>&1
# 每周一 03:00 对最近一份快照执行 restore smoke在临时目录不改原快照
0 3 * * 1 cd /srv/gaokao-volunteer-system && latest=$(find "$GAOKAO_BACKUP_ROOT" -mindepth 1 -maxdepth 1 -type d -name 'backup-*' | sort | tail -n 1) && test -n "$latest" && bash scripts/backup_verify.sh --from-backup "$latest" >> /var/log/gaokao-backup-verify.log 2>&1