2007年10月6日 星期六

在命令列模式上,如何讓更新完畢後自動關閉主機,使用時機是在想睡覺的時候為了節省能源而不被打擾?又,gui介面能否辦到,如何做?

大部分更新都較快,但有些更新檔一次是好幾十mb需要幾個小時才能完成,通常都讓它排在不打擾工作狀態下完成,或許有幾個方向可以下手,例如排程管理cron(好像是)等等。

至於pgp、gpg個人驗證資訊得需要好好學習應用一下。

2 意見:

匿名 提到...

# apt-get upgrade ; init 0;

我一般都這樣做的,cron job有個風險,就是你預定的時間可能還沒更新完。

yugu 提到...

to 大狂:
; init 0;如果是一個套件我搜不到,但找到一個叫「sleepenh」套件它的簡要說明是:Sleep until a given date with subsecond resolution
sleepenh is an sleep program for using in shell scripts
that need to perform a loop that repeats at a regular
time interval, without cumulative errors.

It supports microsecond resolution.

You can also specify the time you need between two calls
of sleepenh.

Here follows an usage example to clarify its purpose. This
example sends 'A' to ttyS0 every 1.2 seconds.
#!/bin/sh
# does not wait (or wait 0), just to get initial timestamp
TIMESTAMP=`sleepenh 0`
while true; do
# send the byte to ttyS0
echo -n "A" > /dev/ttyS0;
# wait until the required time
TIMESTAMP=`sleepenh $TIMESTAMP 1.200`;
done

For more details, please read the manpage.

也許是我套件庫中沒有來此套件之來源?