RunTransfer.ps1 - lowfar/DataIntegrationForEcom GitHub Wiki

Synposis

Transfers files using ROBOCOPY. The script is a wrapper for ROBOCOPY. The wrapper allows the setting of ROBOCOPY switches in a configuration file. The script extracts the properties from the configuration file and sets the source, destination and logging options for ROBOCOPY. SQL Sever Procedures are also executed to monitor the transfer of files.

Author

Matthew Haigh, DBA Team, IT Operations

Overview

Step by step description of what the script does.

  • Define variables
  • Load FileTransferFunctions.ps1
  • Get settings from configuration files by calling GetConfigProperty function
  • Set and format date time to be used as part of the log file name
  • Check if transfer is active, this is a setting in the configuration file
  • If active get information about the files to moved. Sets variables for number and size of files
  • Initiates monitoring process by calling the LogTransferProcess function
  • Set variable for log file name
  • Runs ROBOCOPY
  • Updates monitoring history table by calling LogUpdateTransferEnd function

Parameters

  • $ConfigurationFile: Full path of the configuration file you want to use
  • $IsLocalCopyRequired: Do you want a copy of all the files to be transferred. Selecting 'Y' will run an addition ROBOCOPY command to copy the files before performing the transfer. A value of 'N' will mean no copy is taken.