在学习/理解 Linux 的过程中(困难但享受)。我编写了一个非常短的 shell 脚本,它使用 wget 从网站中提取一个 index.html 文件。
#!/bin/bash
#Script to wget website mywebsite and put it in /home/pi/bin
index=$(wget www.mywebsite.com)
Run Code Online (Sandbox Code Playgroud)
当我在命令行中输入命令 wget_test 时,这会起作用。它将 .html 文件输出到 /home/pi/bin。
我已开始尝试通过 cron 执行此操作,以便我可以在特定时间执行此操作。我使用 crontab -e 输入了以下内容
23 13 * * * /home/pi/bin/wget_test
Run Code Online (Sandbox Code Playgroud)
在此示例中,我希望脚本在 13.23 运行并将 .html 文件输出到 /home/pi/bin 但什么也没发生。
cron ×1