使用crontab執行apt-get出現錯誤 - Linux
By Catherine
at 2013-03-14T18:29
at 2013-03-14T18:29
Table of Contents
[問題描述]無法使用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:
......
請問應如何修正??
謝謝
--
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:
......
請問應如何修正??
謝謝
--
Tags:
Linux
All Comments
By Jacob
at 2013-03-19T06:07
at 2013-03-19T06:07
Related Posts
openSUSE 12.3 Out Now!
By Hamiltion
at 2013-03-14T01:37
at 2013-03-14T01:37
fstab設定user權限
By Doris
at 2013-03-13T20:43
at 2013-03-13T20:43
DNS 只反查 hostname的部分,而不是FQDN
By Irma
at 2013-03-13T17:33
at 2013-03-13T17:33
skype什麼時候才能更新到6.0?
By Kama
at 2013-03-13T02:52
at 2013-03-13T02:52
kernel module 如何使用 driver
By Doris
at 2013-03-13T02:15
at 2013-03-13T02:15