【发布时间】:2019-02-28 12:23:19
【问题描述】:
我的本地 crontab 文件中有以下时间表:
*/10 * * * * /usr/local/bin/node /Users/harrisoncramer/CrontabScripts/dsca-arms-sales/xmlParser.js
它使用节点来运行我的文件的本地副本。我还将这个节点项目存储在 Digital Ocean 上。但是,当我尝试编写一个非常相似的时间表时,我收到以下错误:
"/tmp/crontab.Wf1279/crontab":0: bad minute
errors in crontab file, can't install.
Do you want to retry the same edit?
crontab 文件如下所示:
10/* * * * * nodejs /home/harrisoncramer/dsca_sales_tracker/xmlParser.js
# Edit this file to introduce tasks to be run by cron.
# Each task to run has to be defined through a single line
# indicating with different fields when the task will be run
# and what command to run for the task....etc.....
Digital Ocean 规定,当你想使用 node 运行应用程序时,你应该在你的 crontab 中引用 nodejs。 当我简单地使用所有通配符运算符时,该脚本有效。当我尝试将其转换为“每 10 分钟”时,它会中断。
我做错了什么?
【问题讨论】:
-
*/10与10/*不同。 -
哇。太简单了,对不起!
标签: node.js server cron scheduled-tasks digital-ocean