Skip to content

获取所有计划任务列表

获取面板中所有计划任务的完整列表,包含任务配置、状态、执行周期等信息。

POST
https://your-panel.example.com:8888/crontab
更新于 查看 Markdown

Request bodyX-WWW-FORM-URLENCODEDrequired

  • request_timestringrequired

    Unix 时间戳。

  • request_tokenstringrequired

    按 API 概览生成的签名。

  • actionGetCrontabrequired

    具体操作名称。

Returns

default

接口响应,业务状态见下方详细说明。

JSON
  • idoptionalinteger

    任务 ID

  • nameoptionalstring

    任务名称

  • typeoptionalstring

    周期类型:day、minute-n、hour、week、month

  • where1optionalstring

    周期值(天数/分钟数)

  • where_houroptionalinteger

    执行小时

  • where_minuteoptionalinteger

    执行分钟

  • statusoptionalinteger

    1 = 启用,0 = 暂停

  • sTypeoptionalstring

    任务类型:toShell、toUrl、site、database、logs

  • sBodyoptionalstring

    执行内容

  • echooptionalstring

    唯一标识符

  • saveoptionalinteger

    备份保留份数

各操作详细说明

GetCrontabaction=GetCrontab获取所有计划任务列表

获取面板中所有计划任务的完整列表,包含任务配置、状态、执行周期等信息。

  • 路由:POST /crontab
  • action:GetCrontab

输入参数

参数名称 必选 类型 描述
action 是 String 固定值 GetCrontab

输出参数

返回数组,每项:

参数名称 类型 描述
id Integer 任务 ID
name String 任务名称
type String 周期类型:day、minute-n、hour、week、month
where1 String 周期值(天数/分钟数)
where_hour Integer 执行小时
where_minute Integer 执行分钟
status Integer 1 = 启用,0 = 暂停
sType String 任务类型:toShell、toUrl、site、database、logs
sBody String 执行内容
echo String 唯一标识符
save Integer 备份保留份数

示例

POST /crontab HTTP/1.1
Content-Type: application/x-www-form-urlencoded

request_time=1700000000&request_token=xxx&action=GetCrontab
[{
    "id": 1,
    "name": "续签Let's Encrypt证书",
    "type": "day",
    "where_hour": 10,
    "where_minute": 15,
    "status": 1,
    "sType": "toShell"
}]
Navigation

Type to search…

↑↓ navigate↵ selectEsc close