リストア時にファイルのユーザー/グループ属性を変更する

ファイルをリストアする際、P5は、ファイルが保存された時と同じようにユーザーおよびグループ属性を含むすべてのファイル属性を復元します。

旧バージョン3.0.6以降から、UNIXホストからのリストア実行時に、ユーザーおよびグループファイル属性を変更できるようになりました。

たとえば、ファイルを保存した時にオーナーとなっていたユーザーと異なるユーザーがファイルをリストアしたい場合に、リストア後のファイルにアクセスする権限の問題を発生しないようにする場合や、別のコンピューターからリストアを実行したい場合などに便利です。

具体的には、オリジナルのユーザーとグループidを新しいidに割り当てることで実現可能で、下記の設定ファイルを編集して行うことができます。

/usr/local/aw/conf/lexxsrv.8000
(※ポート番号を変更している場合は8000の部分が任意のポート番号となっている場合があります)

割当て(マッピング)を有効にするには、下記の行を次の要領で改変します。

ns_section ns/server/$server/module/jobex/restore/localhost
ns_param userMap "mymapping"
ns_param groupMap "mymapping"

"userMap"は新しい割当先のidです。
"groupMap"は新しいグループidです。

この2つの行を削除すると、もともとの割当を行わない設定に戻り、オリジナルのユーザーとグループでファイルが復元されます。

設定ファイルを編集して保存後、P5を再起動してサーバーの設定変更を反映させます。


Each mapping, in the above lines shown as "mymapping" is declared to have the following format:
"original-id-1 replacement-id-1" "original-id-2 replacement-id-2" "original-id-3 replacement-id-3" ...

The placeholder "-1" stands for any id, e.g. the following line:
ns_param groupMap "-1 100"
defines a mapping from any group id to the id 100.

The following map:
ns_param userMap "0 500 100 100 101 105 -1 110"
defines the following conversion:

    All files of root (id 0) are changed to user id 500
    All files of user 100 keep the user id
    All files of user 101 are changed to user id 105
    All other files are mapped to the user id 110


The section heading in the above

ns_section ns/server/$server/module/jobex/restore/localhost

refers to the host "localhost". In case the mapping shall be applied on a different host, enter that hosts client name (from the PresSTORE Client list) instead of the "localhost".