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"
}]