azure - Microsoft 令人困惑的 CRON 作业答案

标签 azure cron

这是 Microsoft AZ-204 练习论文中的问题:

You create a batch routine by using a timer trigger in Azure Functions. You need to configure the batch routine to execute every 15 minutes. Which code segment should you use?

正如您在下面的屏幕截图中看到的,建议的答案是 *0 /15 * * * 1-5

据我所知,CRON 格式的第二个字段是小时,所以它对我来说没有意义。谁能解释一下吗?

enter image description here

最佳答案

函数不使用常规 UNIX cron 表达式。

Azure Functions uses the NCronTab library to interpret NCRONTAB expressions. An NCRONTAB expression is similar to a CRON expression except that it includes an additional sixth field at the beginning to use for time precision in seconds:

{second} {minute} {hour} {day} {month} {day-of-week}

另外:

NCRONTAB expression supports both five field and six field format. The sixth field position is a value for seconds which is placed at the beginning of the expression.

来源:https://learn.microsoft.com/en-us/azure/azure-functions/functions-bindings-timer?tabs=python-v2%2Cin-process&pivots=programming-language-csharp#ncrontab-expressions

关于azure - Microsoft 令人困惑的 CRON 作业答案,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/76085992/

相关文章:

visual-studio - Visual Studio 发布配置文件 : Delete specific folder on the server before publishing

node.js - 如何将 Node 计划模块添加到expressjs应用程序

linux - ssh cronjob 删除不起作用

php - 带数学的 where 子句

sql-server - SQL Azure 跨数据库查询权限

java - 通过 FTP 进行 Azure Java 部署而不解压

java - Azure Tomcat Eclipse 部署

python - 将 XML 文件内容发送到事件中心并从 Databricks 读取它

linux - 如何启动 cron 作业删除偏移量?

php - 在 PHP 代码中启用禁用 Cron