Humanity

Edit the world by your favorite way

Debianで更新があったらメールされたい

されたい。
のでcron-aptを使う。

sudo apt-get install cron-apt

して、設定ファイル(/etc/cron-apt/config)を書き換える。
アップグレードする設定にもできるけどメール通知のみにする。

--- /etc/cron-apt/config.bak    2012-03-13 01:02:33.838567688 +0900
+++ /etc/cron-apt/config        2012-03-13 01:06:56.342567655 +0900
@@ -11,7 +11,7 @@
 # OBSERVE that this tool is indended for apt-get and tools like aptitude do not
 # have full support for noninteractive upgrades. You may have to tune options
 # to not create infinit logfiles for example.
-# APTCOMMAND=/usr/bin/apt-get
+APTCOMMAND=/usr/bin/apt-get
 # APTCOMMAND=/usr/bin/aptitude
 # APTCOMMAND=/usr/bin/apt-file

@@ -83,7 +83,7 @@
 # MAIL="/var/log/cron-apt/mail"

 # The email address to send mail to.
-# MAILTO="root"
+MAILTO="root"

 # When to send email about the cron-apt results.
 # Value: error   (send mail on error runs)
@@ -92,7 +92,7 @@
 #       output  (send mail when output is generated)
 #        always  (always send mail)
 #                (else never send mail)
-# MAILON="error"
+MAILON="upgrade"

 # Value: error   (syslog on error runs)
 #       upgrade (when packages is upgraded)

こんなんでいいのかな?とりあえず様子見。