[問題] 使用crontab執行apt-get出現錯誤
[問題描述]無法使用crontab自動執行apt-get更新
sudo crontab -l
# m h dom mon dow command
0 3 * * * sh /home/username/crontab.sh
vim /home/username/crontab.sh
#!/bin/bash
PATH=/usr/bin:/bin:/usr/sbin:/sbin
apt-get -qq update 2>> /home/username/crontab_$(date '+%Y_%m_%d').log
apt-get -qq dist-upgrade 2>> /home/username/crontab_$(date '+%Y_%m_%d').log
Error Log
debconf: unable to initialize frontend: Dialog
debconf: (TERM is not set, so the dialog frontend is not usable.)
debconf: falling back to frontend: Readline
debconf: unable to initialize frontend: Readline
debconf: (This frontend requires a controlling tty.)
debconf: falling back to frontend: Teletype
dpkg-preconfigure: unable to re-open stdin:
......
請問應如何修正??
謝謝
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 210.71.78.252
推
03/18 23:59, , 1F
03/18 23:59, 1F
→
03/18 23:59, , 2F
03/18 23:59, 2F
→
03/18 23:59, , 3F
03/18 23:59, 3F