Crontab 格式如下:

*     *     *     *     *  command to be executed
-     -     -     -     -
|     |     |     |     |
|     |     |     |     +----- day of the week (0 - 6) (Sunday is 0)
|     |     |     +------- month (1 - 12)
|     |     +--------- day of the month (1 - 31)
|     +----------- hour (0 - 23)
+------------- min (0 - 59)

要设置一分钟,只需将分钟字段设置为 ' * ',表示每分钟都执行该命令。

例如,要在每分钟执行一个脚本,可以使用以下命令:

* * * * * /path/to/script.sh

这将在每小时的每分钟执行该脚本。

Crontab 格式:如何设置每分钟执行任务

原文地址: https://www.cveoy.top/t/topic/nl7q 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录