fao/scripts/cron/fao-ingest.crontab.example
2026-04-23 19:24:46 +08:00

16 lines
986 B
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.

# 示例 crontabFAO Python 采集(仅写 raw。安装前请全文替换路径、适配器与日志路径。
# 安装crontab /path/to/fao/scripts/cron/fao-ingest.crontab.example
#
# 依赖:已配置 MySQLFAO_MYSQL_*http_json 适配器还需 FAO_HTTP_JSON_URL 等(见 config/.env.example
SHELL=/bin/bash
PATH=/usr/local/bin:/usr/bin:/bin
# GNU cron 支持时,建议固定为上海时区,避免与业务「交易日」错位
CRON_TZ=Asia/Shanghai
# 每 30 分钟执行一次 http_json 适配器(按授权与频控改为 15m / 60m 等)
*/30 * * * * cd /ABS/PATH/TO/fao && [ -f config/.env ] && set -a && . ./config/.env && set +a && ./scripts/run_ingest.sh --adapter http_json >> /var/log/fao/ingest.log 2>&1
# 备用:仅本地/演示用 demo_json不访问外网
# 15 * * * * cd /ABS/PATH/TO/fao && [ -f config/.env ] && set -a && . ./config/.env && set +a && ./scripts/run_ingest.sh --adapter demo_json >> /var/log/fao/ingest-demo.log 2>&1