Skip to content
定时任务
2025年7月23日 root

定义脚本

bash
#!/usr/bin/env bash
set -euo pipefail
cd "$(dirname "$0")"
# to do something

脚本可运行

bash
chmod +x /bash/path/run.sh

添加到定时任务

bash
crontab -e
txt
15 2 * * * /bash/path/run.sh
  • 每天 02:15 执行

Last updated: