数字海洋服务器中的crontab调度
Crontab Scheduling In Digital Ocean Server
我的本地 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。 当我只使用所有通配符时,该脚本有效。当我尝试将其转换为 "every 10 minutes."
时它中断了
我做错了什么?
您的 crontab 语法错误已关闭。到 运行 一个命令,例如每 10 分钟使用
*/10 * * * * /path/to/the/command
.
您可以找到有关 crontab 配置的更多信息 here。
我的本地 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。 当我只使用所有通配符时,该脚本有效。当我尝试将其转换为 "every 10 minutes."
时它中断了我做错了什么?
您的 crontab 语法错误已关闭。到 运行 一个命令,例如每 10 分钟使用
*/10 * * * * /path/to/the/command
.
您可以找到有关 crontab 配置的更多信息 here。