code-test

2013年10月3日 星期四

備份自己 FreeBSD system configuration(系統檔案)使用 tar 指令.


備份自己 FreeBSD system configuration(系統檔案).

I set up a simple script to create a configuration backups of my FreeBSD box and I thought I would share it. Note that this script will only back up the /etc and /usr/local/etc directories and weighs in at just under 1MB per backup.

First create a backup script as we can't execute our complex command directly in cron.  You may want to customize the exclude options to your licking, the two listed exclusions are the rather large gconf defaults, witch is not needed, and the working files for transmission.
[root@FB91lab02 /home]#vi /usr/local/sbin/backup-config
貼上下面的內容
bash -c 'tar -Pczf /root/freebsd-cfg-`date "+%Y-%m-%d"`.tgz --exclude={etc/gconf,usr/local/etc/transmission/home/{resume,torrents,Downloads,blocklists}} /etc/ /usr/local/etc/'

Now make it executable.
chmod +x /usr/local/sbin/backup-config

Now add the job to cron and set it to run weekly as root.
修改 cron job
[root@FB91lab02 /home]#vi /etc/crontab

每周備份
# Backup the entire server configuration once a week.
0 1 * * 0 root backup-config 2>/dev/null



tar備份打包時,預設為相對路徑;而排除匹配式預設也是全路徑匹配的所以,在打包時,會提示:“tar: Removing leading `/ from member names”除非你使用-P參數或特定的參數指定。 
它是tar命令為了避免不必要的錯誤而做的限制。如果使用者在壓縮檔時使用了絕對路徑,那麼tar會自動的剝離掉第一個‘/’。 
例如,你想備份/etc的內容: 
$tar -zcvf etc.gz /etc 
生成了一個壓縮包,那麼在解壓這個壓縮包的時候,內容會被寫入到/etc這個目錄,可能潛在的造成風險。 
經過tar剝離第一個’/’後,解壓時壓縮包的內容會被釋放到目前的目錄,即:./etc 
如果非要使用絕對路徑,那麼請加-P參數(解壓縮時也需要加上這個參數)。 
如果想蓋面解壓縮目錄,請加-C參數。

以上取至於網路 如有冒犯 請來信告知  oscarnetwu@gmail.com   

netapp 進階模式

netapp 進階模式

今天設定 netapp 進階模式 順便紀錄一下


filer> priv set advanced
Warning: These advanced commands are potentially dangerous; use
         them only when directed to do so by NetApp
         personnel.
filer*>

options min_spare_count 0

priv set advanced

options raid.min_spare_count 0





下如過要離開的話很簡單 只要執行一下 這個指令

filer*> priv set

filer>

2013年10月2日 星期三

框架設定

框架設定

以上資訊 都取自於網路 如有冒犯 請來信告知 oscarnetwu@gmail.com 謝謝!

STEP1:【框架概念】
  1. 框架的設定是跟其他的HTML標籤太一樣。他的用法是在一個網頁上擺上數個網頁。我的首頁就是一個例子。
    現在你假裝想像一個frame是你整個螢幕的大小, 而 frame 的標籤就是把整個螢幕分成許多部分。
  2. 接下來, 讓我來看右邊這張圖。 框架說明圖
    ??右邊那個 index.html 是什麼啊? 在右邊這張圖, 我們用 index.html 這個網頁把其他 a.html, b.html, 和 c.html 三個網頁呈現在index.html這網頁上。簡單來說, 就是我們需要多個網頁來作一個有數個框架的網頁。
  3. 大概知道框架的概念了吧? 我們要幾個框架, 就需要多少個 HTML 網頁就是了。接下來是語法講解...。