web*_*toe 10
我认为是这样的:
30/5 9-16 * * * /usr/bin/script_to_run.sh
Run Code Online (Sandbox Code Playgroud)
有关时序语法的详细信息,请参阅wiki 页面。我建议使用一个脚本来测试它,该脚本将它运行的时间记录到一个文件中。
#!/bin/bash
echo "Cron ran at: " `date` >> /var/log/crontimetest.log
Run Code Online (Sandbox Code Playgroud)
你需要三个 crontab 条目:
30-55/5 9 * * * /usr/bin/script-to-run.sh
*/5 10-15 * * * /usr/bin/script-to-run.sh
0-30/5 16 * * * /usr/bin/script-to-run.sh
Run Code Online (Sandbox Code Playgroud)
请不要因为 crontab 条目的奇怪和无用的语法而责怪 linux、bsd 或我。这是在 AT&T 贝尔实验室发明的,后来作为 POSIX 的一部分进行了标准化。