ラベル Solarisメモ の投稿を表示しています。 すべての投稿を表示
ラベル Solarisメモ の投稿を表示しています。 すべての投稿を表示

2009年5月13日

Solaris 10 tarコマンドでの除外リストについて

Solaris 10のtarコマンドで一部を除外して展開する方法のmemo

tarコマンドにXオプションと除外リストが記載されたファイルを
指定することで、一部のファイル・ディレクトリを省いて展開する事が
出来ます。

詳細は、 tar(1) – テープアーカイブの作成およびファイルの追加または抽出

man コマンドの説明がわかり辛いので以下実例です。

▼tar tvfコマンドでtarファイルの中身を閲覧

 -bash-3.00$ tar tvf ../test.tar
 drwxr-xr-x 101/10 0 5月 13日 18:13 2009年 testdir/
 drwxr-xr-x 101/10 0 5月 13日 18:13 2009年 testdir/1/
 -rw-r--r-- 101/10 0 5月 13日 18:13 2009年 testdir/1/a
 -rw-r--r-- 101/10 0 5月 13日 18:13 2009年 testdir/1/b
 -rw-r--r-- 101/10 0 5月 13日 18:13 2009年 testdir/1/c
 -rw-r--r-- 101/10 0 5月 13日 18:13 2009年 testdir/1/d
 -rw-r--r-- 101/10 0 5月 13日 18:13 2009年 testdir/1/e
 -rw-r--r-- 101/10 0 5月 13日 18:13 2009年 testdir/1/f
 -rw-r--r-- 101/10 0 5月 13日 18:13 2009年 testdir/1/g
 drwxr-xr-x 101/10 0 5月 13日 18:14 2009年 testdir/2/
 -rw-r--r-- 101/10 0 5月 13日 18:14 2009年 testdir/2/1
 -rw-r--r-- 101/10 0 5月 13日 18:14 2009年 testdir/2/2
 -rw-r--r-- 101/10 0 5月 13日 18:14 2009年 testdir/2/3
 -rw-r--r-- 101/10 0 5月 13日 18:14 2009年 testdir/2/4
 -rw-r--r-- 101/10 0 5月 13日 18:14 2009年 testdir/2/5
 -rw-r--r-- 101/10 0 5月 13日 18:14 2009年 testdir/2/6
 drwxr-xr-x 101/10 0 5月 13日 18:14 2009年 testdir/3/
 -rw-r--r-- 101/10 0 5月 13日 18:14 2009年 testdir/3/7
 -rw-r--r-- 101/10 0 5月 13日 18:14 2009年 testdir/3/8
 -rw-r--r-- 101/10 0 5月 13日 18:14 2009年 testdir/3/9
 -rw-r--r-- 101/10 0 5月 13日 18:14 2009年 testdir/3/10
 -rw-r--r-- 101/10 0 5月 13日 18:14 2009年 testdir/3/11
 -rw-r--r-- 101/10 0 5月 13日 18:14 2009年 testdir/3/12

 
▼exclude-fileを表示

 -bash-3.00$ cat exclude-file
 testdir/2
 


▼exclude-fileを除外してtarファイルの中身を確認

 -bash-3.00$ tar tvfX ../test.tar ./exclude-file
 drwxr-xr-x 101/10 0 5月 13日 18:13 2009年 testdir/
 drwxr-xr-x 101/10 0 5月 13日 18:13 2009年 testdir/1/
 -rw-r--r-- 101/10 0 5月 13日 18:13 2009年 testdir/1/a
 -rw-r--r-- 101/10 0 5月 13日 18:13 2009年 testdir/1/b
 -rw-r--r-- 101/10 0 5月 13日 18:13 2009年 testdir/1/c
 -rw-r--r-- 101/10 0 5月 13日 18:13 2009年 testdir/1/d
 -rw-r--r-- 101/10 0 5月 13日 18:13 2009年 testdir/1/e
 -rw-r--r-- 101/10 0 5月 13日 18:13 2009年 testdir/1/f
 -rw-r--r-- 101/10 0 5月 13日 18:13 2009年 testdir/1/g
 testdir/2/ を除外します。
 testdir/2/1 を除外します。
 testdir/2/2 を除外します。
 testdir/2/3 を除外します。
 testdir/2/4 を除外します。
 testdir/2/5 を除外します。
 testdir/2/6 を除外します。

 drwxr-xr-x 101/10 0 5月 13日 18:14 2009年 testdir/3/
 -rw-r--r-- 101/10 0 5月 13日 18:14 2009年 testdir/3/7
 -rw-r--r-- 101/10 0 5月 13日 18:14 2009年 testdir/3/8
 -rw-r--r-- 101/10 0 5月 13日 18:14 2009年 testdir/3/9
 -rw-r--r-- 101/10 0 5月 13日 18:14 2009年 testdir/3/10
 -rw-r--r-- 101/10 0 5月 13日 18:14 2009年 testdir/3/11
 -rw-r--r-- 101/10 0 5月 13日 18:14 2009年 testdir/3/12


tvfをxvfに変更すれば、excplude_listを指定してのファイル展開になります。

2009年5月10日

Solaris IPMP(IPマルチパス)

IPMPのmemo

 第 30 章 IPMP の紹介 (概要)
 http://docs.sun.com/app/docs/doc/819-0380/ipmptm-1?l=ja&a=view
 > Solaris 10 System Administrator Collection - Japanese   
 > Solaris のシステム管理 (IP サービス) > IPMP

・複数NICで冗長化させるもの
・ネットワークの正常性監視は、下記で行われる。

 1.リンクベースの障害検出
  
  -インターフェースのRUNNING フラグで判断(Solaris10からの機能)

 2.検査信号(Ping)ベースの障害検出 ★こっちが一般的
  
  -デフォルトゲートウェイがある:デフォルトゲートウェイ宛てのPing
  -デフォルトゲートウェイがない:マルチキャストPingに応答するホスト
  -- route add host aaa.bbb.ccc.ddd aaa.bbb.ccc.dddなどと設定することで、
    検査用ホストを手動で設定が可能。
  
   どのホストが検査対象になっているかは、snoopコマンドでicmpのパケットが
   どこに飛んでるかで確認することが可能。
   
・設定ファイルは、/etc/default/mpathd
・障害試験は、if_mpadmコマンド

■手動での設定方法

1.インターフェースをグループ化

 # ifconfig hme0 group testgroup1
 # ifconfig hme1 group testgroup1

2.インターフェースの設定
 
 今回は、二つのインターフェースでサービス用IPアドレスを
 論理インターフェースで構成する事を想定。

 (1)検査用インターフェースの設定

  # ifconfig hme0 10.0.0.1 netmask + broadcast + -failover deprecated up
  # ifconfig hme1 10.0.0.2 netmask + broadcast + -failover deprecated up

 (2)サービス用インタフェースの設定

  # ifconfig hme0 addif 10.0.0.10 netmask + broadcast + up

 これでhme0の経路でLinkDownなどが検地されば「10.0.0.10」が移動する。

 再起動後も有効にしたいなら、/etc/hostname.hme0と/etc/hostname.hme1にも書く。  

 ifconfig結果を載せたいけどblogがエラーになるので、断念・・・