gpt4 book ai didi

linux - 在 cron 作业中为 url 提供凭据

转载 作者:太空狗 更新时间:2023-10-29 11:10:35 26 4
gpt4 key购买 nike

我需要编写一个 cron 作业,每天访问一个 url。问题是这个 url 需要身份验证。如何通过 cron 作业验证和访问 url?

谢谢

最佳答案

然后写一个脚本,例子来自wget手册

# Log in to the server.  This can be done only once.
wget --save-cookies cookies.txt \
--post-data 'user=foo&password=bar' \
http://server.com/auth.php

# Now grab the page or pages we care about.
wget --load-cookies cookies.txt \
-p http://server.com/interesting/article.php

然后从用户 cron 或系统 cron 调用此脚本。

关于linux - 在 cron 作业中为 url 提供凭据,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9782305/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com