3.12. File System
3.12.3. Script Action: Copy directory
Function
Copies the contents of one directory to another directory. The source and destination directory can reside on different computers. A number of options are available: create the destination directory, setup permissions, copy permissions etc.
Deployment
This action is typically used in a script that is intended to manage existing user accounts and move for instance home directories.
By combining the action Copy directory and Delete directory on page 190 the Move directory action can be implemented.
Besides copying the files and directories, the security permissions can be setup for the destination directories and files. For the permissions, three options are available:
1. Copy security settings from source directory: All permissions settings are copied for each individual file and
directory. To select, set the property Copy security option to Yes and property Setup security option to No. 2. Setup security settings for destination directories and files: Initialize the security settings for the destination files
and directories. The security settings of the source directories and files are not used. Instead, you can specify the new security settings for the destination files and directories. To select, set the property Copy security option to No and property Setup security option to Yes and specify the security settings with property Security.
3. No configuration: The copy operation is executed but not security settings are explicitly setup. The security settings of
the destination directory and files are determined by the security settings of the destination parent directory and inheritance rules. To select, set the property Copy security option to No and property Setup security option to No. This is the default option.
184
Properties
Property
Name Description Typical setting Remarks
Source directory The name of source directory. The source directory can be specified in two ways: For local directories: <logical drive>\\<directory>\\<directory> etc.
Example: 'C:\\UserData\\Marketing'.
For remote and local directories: \\\\<computer>\\ <share>\\ <directory>\\ <directory>.
Example: '\\\\SERVER_A\\Users\\Data'. The source directory must exist.
Destination
directory The name of destination directory. The destination directory can be specified in two ways: For local directories: <logical drive>\\<directory>\\<directory> etc.
Example: 'C:\\UserData\\Marketing'. For remote and local directories:
\\\\<computer>\\<share>\\<directory>\\<directory>. Example: '\\\\SERVER_A\\Users\\Data'. If the
destination directory does not exist, it can be created.
If the destination directory does not exist, it can be created by setting property Create destination directory to Yes. This will create the full path if necessary.
Create destination directory
A flag indicating that the destination directory must be
created if it does not exist. Default value: 'Yes'. Yes If not specified, the default value Yes is applied.
Copy
subdirectories Specify 'Yes' to copy the complete directory tree, including subdirectories and files, and subdirectories of subdirectories.
Yes If not specified, the
default value Yes is applied.
Copy directories,
no files Specify 'Yes' to copy directories only, no files. Default value: 'No'. If you specify 'Yes', no files are copied, only the directory tree is copied to the destination directory.
No If not specified, the
default value No is applied.
185
Use backup and restore
privileges
A flag indicating that backup and restore privileges must be used to copy the directory. This property is required in case the logged on user has no access rights to the directories and files that must be copied. The logged on user must have the corresponding access rights configured on the target computer to use these privileges successfully. Default value: 'Yes'.
Yes If not specified, the
default value Yes is applied. The access rights are configured using policies. Depending on the environment, Domain security, Domain Controller Security or Local Security policies apply. The backup and restore privileges are configured by settings the Backup files and directories and Restore files and directories policies of the User Rights Assignment for the logged on user account. Continue on
error A flag indicating that the copy directory action must continue if an error occurs when copying a file or directory. Default value: 'Yes'.
Yes If set to Yes the copy
action continues, but an error will be reported and is returned by the action.
Overwrite
existing files A flag indicating that existing destination files must be overwritten if they already exist. If you specify 'No' instead, an error is generated and the file is not overwritten. Default value: 'Yes'.
Yes
Copy security
option Copy security settings from the source directory and files to the destination directory and files. The security settings include the access rights, owner and auditing settings. If the security is not explicitly specified, the security settings of the destination parent directory determine the new security settings.
See Deployment section.
Setup security
option Setup the security settings for the target directory and files. The security settings include the access rights, owner and auditing settings. The security settings are specified with the property Security settings. If the security is not explicitly specified, the security settings of the destination parent directory determine the new security settings.
See Deployment section.
186
Security The new security settings for the target directory and files. If you want to use this option, you must set the value of property 'Setup security option' to 'Yes'.
This property is only used when the value of property Setup security option is set to Yes. For more information, see Security - Overview on page Fout!
Bladwijzer niet gedefinieerd..
187