diff --git a/ATxCommon/Serializables/ServiceConfig.cs b/ATxCommon/Serializables/ServiceConfig.cs index ea06d3853775935111bc88b86c53dafc5b933262..2fd864a723e9e01b85ac09e3a841292d2b4fe81a 100644 --- a/ATxCommon/Serializables/ServiceConfig.cs +++ b/ATxCommon/Serializables/ServiceConfig.cs @@ -117,6 +117,18 @@ namespace ATxCommon.Serializables /// See the RoboCopy documentation for more details. public int InterPacketGap { get; set; } = 0; + /// <summary> + /// Setting for the RoboCopy /COPY parameter, valid flags are D=Data, A=Attributes, + /// T=Timestamps, S=Security(ACLs), O=Owner info, U=aUditing info. Default: "DT". + /// </summary> + public string CopyFlags { get; set; } = "DT"; + + /// <summary> + /// Setting for the RoboCopy /DCOPY parameter, valid flags depend on the version of + /// RoboCopy used and should only be changed with greatest care! Default: "T". + /// </summary> + public string DirectoryCopyFlags { get; set; } = "T"; + /// <summary> /// A list of process names causing transfers to be suspended if running. /// </summary> diff --git a/ATxService/RoboCommand.cs b/ATxService/RoboCommand.cs index 36dd9d6513d740ba0c81af2d84275e47f3c4382b..113e1006e746b84e657b432d908ac10227c01fef 100644 --- a/ATxService/RoboCommand.cs +++ b/ATxService/RoboCommand.cs @@ -68,14 +68,10 @@ namespace ATxService // copyflags : // D=Data, A=Attributes, T=Timestamps // S=Security=NTFS ACLs, O=Owner info, U=aUditing info + _roboCommand.CopyOptions.CopyFlags = _config.CopyFlags; - // /SEC :: copy files with security (equivalent to /COPY:DATS) - // _roboCommand.CopyOptions.CopyFilesWithSecurity = true; - // /COPYALL :: copy all file info (equivalent to /COPY:DATSOU) - // _roboCommand.CopyOptions.CopyAll = true; - _roboCommand.CopyOptions.CopyFlags = "DT"; - - _roboCommand.CopyOptions.DirectoryCopyFlags = "T"; + // /DCOPY :: directory copy settings (T=Timestamps) + _roboCommand.CopyOptions.DirectoryCopyFlags = _config.DirectoryCopyFlags; // select options _roboCommand.SelectionOptions.ExcludeOlder = true;