[問題] 使用crontab執行apt-get出現錯誤

看板Linux作者 (蒲公英)時間11年前 (2013/03/14 18:29), 編輯推噓1(102)
留言3則, 1人參與, 最新討論串1/1
[問題描述]無法使用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
這ip是建中?為啥要打一長串 apt-get update && apt-ge
03/18 23:59, 1F

03/18 23:59, , 2F
t dist-upgrade -y --force-yes 直接寫在crontab 後面
03/18 23:59, 2F

03/18 23:59, , 3F
不就好?
03/18 23:59, 3F
文章代碼(AID): #1HGQQ13k (Linux)