這裏顯示兩個版本的差異處。
Both sides previous revision 前次修改 下次修改 | 前次修改 | ||
linux:basic [2007/05/08 00:49] wenpei |
linux:basic [2010/04/06 12:19] (目前版本) wenpei |
||
---|---|---|---|
行 1: | 行 1: | ||
+ | ====== 關掉 console 下的蜂鳴器 ====== | ||
+ | sudo modprobe -r pcspkr | ||
+ | |||
+ | 或者用 sudo modconf,找到 drivers/input/misc/pcspkr.ko 並移除。 | ||
+ | |||
====== 家目錄的原始檔 ====== | ====== 家目錄的原始檔 ====== | ||
/etc/skel | /etc/skel | ||
行 106: | 行 111: | ||
scp [file] [username]@[host]:[path] | scp [file] [username]@[host]:[path] | ||
example: | example: | ||
- | scp make.conf fang@140.115.189.106: | + | scp make.conf user@192.168.1.2:~ |
- | 主機後面要加一個「:」 | + | 主機後面要加一個「:」代表遠端的主機,「~」代表遠端的家目錄。 |
====== 透過 ssh 掛載遠端 filesystem ====== | ====== 透過 ssh 掛載遠端 filesystem ====== | ||
行 134: | 行 139: | ||
===== bmon ===== | ===== bmon ===== | ||
===== iftop ===== | ===== iftop ===== | ||
+ | ===== iptraf ===== | ||
行 204: | 行 210: | ||
# uname -snrvm > /var/run/motd | # uname -snrvm > /var/run/motd | ||
# [ -f /etc/motd.tail ] && cat /etc/motd.tail >> /var/run/motd | # [ -f /etc/motd.tail ] && cat /etc/motd.tail >> /var/run/motd | ||
+ | |||
+ | ====== SSH 不檢查 key ====== | ||
+ | ~/.ssh/config | ||
+ | StrictHostKeyChecking no | ||
+ | |||
+ | ====== 備份指令 ====== | ||
+ | ===== bash ===== | ||
+ | http://blog.wu-boy.com/2006/12/10/52 | ||
+ | <code> | ||
+ | #!/bin/bash | ||
+ | date=`date +%Y-%m-%d` | ||
+ | RETENTION_PERIOD="7" | ||
+ | HEADER="Backup data" | ||
+ | remove_oldfiles(){ | ||
+ | echo "Removing directory $1 files older than $RETENTION_PERIOD days" | ||
+ | | wall | ||
+ | find $1 -type f -mtime +$2 -exec rm '{}' \; | ||
+ | } | ||
+ | |||
+ | BACKUPDIR="/home/appleboy /var/www/html" | ||
+ | back_www_dir="/backup01/www_data" | ||
+ | |||
+ | # | ||
+ | # 開始備份 | ||
+ | # | ||
+ | |||
+ | cd $back_www_dir | ||
+ | |||
+ | for TARGET in $BACKUPDIR | ||
+ | do | ||
+ | echo "System backup on $TARGET" | wall | ||
+ | BASENAME=`basename $TARGET` | ||
+ | |||
+ | tar -zcvf ${BASENAME}-${date}.tar.gz $TARGET 1>/dev/null | ||
+ | sleep 2 | ||
+ | done | ||
+ | |||
+ | # | ||
+ | # 刪除7天前的資料 | ||
+ | # | ||
+ | remove_oldfiles $back_www_dir $RETENTION_PERIOD | ||
+ | </code> | ||
+ | |||
+ | ====== Run commands on multiple machines ====== | ||
+ | Fanout and Fanterm: http://blog.wu-boy.com/2010/01/08/1950/ | ||
+ |