crontab

php执行crontab命令

cron [file]

1.先生成cron.txt内容如下:

echo -e 表示遇到\n会换行。

echo -e "0 * * * * curl --insecure https://www.example.com/admin.php/auction_crontab/add_cron_next\n
40 * * * * curl --insecure https://www.example.com/admin.php/auction_crontab/fresh\n
50 * * * * curl --insecure https://www.example.com/admin.php/auction_crontab/fresh\n
58 * * * * curl --insecure https://www.example.com/admin.php/auction_crontab/result\n" > cron.txt

2.然后crontab cron.txt

重启crontab /etc/rc.d/init.d/crond restart

查看crontab运行情况 tail /var/log/cron

https

curl访问https时,--insecure表示忽略https证书验证,否则访问会失败。

curl --insecure https://www.addoom.com

results matching ""

    No results matching ""