我正在尝试wg-quick up myvpn
从 crontab 定期运行,但它似乎失败了。
这很奇怪,因为我从常规 shell 运行相同的命令并且它运行良好。
这是我的 crontab:
*/5 * * * * wg-quick up myvpn >> /home/cron.log 2>&1
该命令wg-quick up myvpn >> /home/cron.log 2>&1
从 shell 运行良好(我 ssh 进入)
这是 cron.log 文件的输出:
[#] ip link add myvpn type wireguard [#] wg setconf myvpn /dev/fd/63 Temporary failure in name resolution: 'my_website:5555'. Trying again in 1.50 seconds... Temporary failure in name resolution: 'my_website.fairtek.com:5555'. Trying again in 2.25 seconds... Temporary failure in name resolution: 'my_website.fairtek.com:5555'. Trying again in 3.38 seconds...
wg-quick 从 crontab 失败但从 shell 运行时没有失败的原因是什么?