Linux定时任务请求一个链接

mac2026-01-29  1

Linux定时任务请求一个链接

1.执行以下命令,进入vim模式,使用i编辑这个crontab文件,使用:wq命令保存。·

crontab -e

2.你可以使用以下的任意三种方式来请求一个链接。

Add ONE of the following lines:·

45 * * * * /usr/bin/lynx -source http://example.com/cron.php 45 * * * * /usr/bin/wget -O - -q -t 1 http://www.example.com/cron.php 45 * * * * curl -s http://example.com/cron.php

3.例如使用wget请求某个链接,我们可以使用下面的格式。

//code from http://caibaojian.com/linux-crontab.html * * * * * wget -O - http://yoursite.com/tasks.php >/dev/null 2>&1 4、.前面的*号代表一下时间· minute: 0of hour: 1of day of month: * (every day of month)of month: * (every month)and weekday: 1-5 (=Monday til Friday)
最新回复(0)