I have a robocopy batch script to use with diskshadow to sync files to a backup server. in vagrant, i tried this, but it prevents the upload of the script
`
-
name: make a folder for backup scripts
win_file:
path: C:\backupscripts
state: directory -
name: set permissions for backup script folder
win_acl:
path: C:\backupscripts
user: Administrator
type: allow
rights: -
FullControl
-
name: set permissions for backup script folder
win_acl:
path: C:\backupscripts
user: Users
type: deny
rights: -
FullControl
-
name: upload backup script
win_template:
src: sync.bat.j2
dest: C:\backupscripts\sync.bat
`
but that results in
`
TASK [upload backup script] ****************************************************
fatal: [wc]: FAILED! => {“changed”: false, “checksum”: “992922fbb15e0a8402e5d47e92e23d2503bd6ac6”, “module_stderr”: “Exception calling "Run" with "1" argument(s): "Exception calling "Invoke" with \r\n"0" argument(s): "The running command stopped because the preference variable \r\n"ErrorActionPreference" or common parameter is set to Stop: Access to the path \r\n’C:\backupscripts\sync.bat’ is denied.""\r\nAt line:65 char:5\r\n+ $output = $entrypoint.Run($payload)\r\n+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\n + CategoryInfo : NotSpecified: ( , ParentContainsErrorRecordE \r\n xception\r\n + FullyQualifiedErrorId : ScriptMethodRuntimeException\r\n \r\n”, “module_stdout”: “”, “msg”: “MODULE FAILURE”, “rc”: 1}
`
So whats the right way to do this? Im new to windows, so please tell me if im missing anything. the target is windows server 2012-r2