copyFileUseCredentials()
Copies a file from a directory on a machine and attempts to copy the file to a target directory and filename. The copy process uses either:
- The agent credential specified for an agent using Agent > Manage Agents, or
- The user credential specified by an impersonateUser() step before this step.
This STEP is mostly used for accessing files across network UNC shares. If the target file exists, you must check a box to overwrite an existing file. Be sure to keep in mind folder syntax when running this STEP across different operating systems, for example, c:\temp\tempfile.txt
for Windows and /tmp/tempfile.txt
for OS X and Linux.
Operating systems supported: Windows, OS X, Linux
Example
useCredential("All Operating Systems", "Halt on Fail")
copyFileUseCredentials("c:\logging\logfile.log", "\\fileserver\log_archive\logfile.log", true, "All Operating Systems", "Halt on Fail")