ROBOCOPY Security情報の更新方法/How to update security info with robocopy?

<テスト環境>
移行元:Windows Server2008
移行先 : Windows2003

<今回やりたいこと>
データのスナップショットを取るために2008のバックアップとして古い2003 serverへrobocopyでバックアップを取っておきたい。
フォルダーやデータはすでにPurge済だが、セキュリティ情報の更新を忘れた。セキュリティ情報の更新をやりたい。

<やってみたけどだめだったこと>
Administartor権限で実行
移行先フォルダのフォルダ権限を「親から継承」を外す
共有アクセス権をEveryoneをFULLにする
次のオプションを使う
robocopy "移行元" "移行先" /E /COPYALL /DCOPY:T /SECFIX /TIMFIX /PURGE /R:0

よくよく調べたら /E +/Purge を/Mir に変更したらうまくいった。
robocopy "移行元" "移行先"  /COPYALL /DCOPY:T /SECFIX /TIMFIX /MIR /R:0

詳細はこちら。
Microsoft Server - Robocopy options
http://technet.microsoft.com/ja-jp/library/cc733145(v=ws.10).aspx

以下同サイトより抜粋
解説
  • /mirオプションと、/e および /purgeオプションでは、1 つの小さな違いを除き同じ動作をします。
    • コピー先ディレクトリが存在する場合、/e および /purgeのオプションでは、コピー先ディレクトリのセキュリティ設定は上書きされません。
    • コピー先のディレクトリが存在する場合は、 /mirオプションでは、移動先ディレクトリのセキュリティ設定が上書きされます。
/mirディレクトリ ツリーをミラー化します。(/e /purge を組み合わせたものに相当します )
------------------------------------------------------------------------------------------------------------------
Do you have a problem copying only security info between source folders and destination folders?

Here is the one of the answer which is worth to try.
- Run robocoy bat file as adminstrator
- Add full access for everyone on SHARE permission, Not SECURITY permission
-Tick OFF "include inheritable permissions from the object's perent" on Folder properties | Advance

If it does not solve yet, please check your robocopy script.

With this options, security info does not updated after having purged all folders.
robocopy "source" "destination" /E /COPYALL /DCOPY:T /SECFIX /TIMFIX /PURGE /R:0

After replaceing /E with /Purge option to /Mir option, all security info was updated successfuly.
robocopy "source" "destination" /COPYALL /DCOPY:T /SECFIX /TIMFIX /MIR /R:0

According to Microsoft Server - Robocopy options, you need to use /MIR option instead of /E + / Purge to sync security info.
http://technet.microsoft.com/ja-jp/library/cc733145(v=ws.10).aspx

Here are the copy from MS official site:
With the /e plus /purge options, if the destination directory exists, the destination directory security settings are not overwritten.
With the /mir option, if the destination directory exists, the destination directory security settings are overwritten.

コメント