The Run Robocopy Job action allows you to pass in Robocopy Job Files (.rcj) that contain the parameters for the Robocopy operation.

Job Files

The Job Files page allows you to list the job files that you want to execute.

About Robocopy Jobs

You can create a Robocopy Job file by using the /SAVE:<filename> switch when running a Robocopy command. When using the save switch to create the job file only the switches that preceed the save switch will be saved to the job file (any switches that occur after the save switch will be omitted from the job file).

If you want to create a job file without actually running the Robocopy operation place the /QUIT switch directly after the save switch. This will cause the operation to abort directly after creating the job file.

This can be done from Automise by using the desired action and adding the /SAVE:<filename> and /QUIT switches in the extra command line arguments field.

Creating a Robocopy job file from a Automise action.

When using Robocopy Job files the commands stored in the files will be executed as a single operation (not an operation per job file). The intention here is that you may use job files to store parameters that are common to a number of Robocopy operations that you intend to perform. For instance if you use the same set of exclusion rules each time you perform a Robocopy oepration you may want to store these rules in a job file and then use this job each time you use Robocopy.

You need to take care not to specify the source or destination directory more than once. If your job file passes the /SD switch (which is the source directory switch, the same goes for the /DD destination directory switch) can only be specified once in the set of jobs. If your set of job files contains either the /SD or the /DD switch then you cannot pass in the source directory or destination directory via the action.

If you want to use the directories specified in your job file then you would need to specify the following for the Source and Destination respectively, /NOSD and /NODD. These arguments stand for No Source Directory and No Destination Directory (which instruct Robocopy to use the values from within the job file). If you want to pass your source and directory in via the action then you need to remove the source directory and destination directory switches from the script (or at least comment them out).

Running a Robocopy job where the source and destination are specified in the file requires the source and destination to be specified as /NOSD and /NODD respectively.

This also allows you to create a job file that uses a common source for instance (where the source directory is specified in the job file using the /SD switch) where you pass the /NOSD switch as the source directory in the action and then specify the destination directory.

Sample Job File

The text below is a sample of what a a Robocopy Job folder. A comment is started by a double semi-colon (::) and can be placed after a switch. As you can see each command line switch is placed on a new line.

:: Sample Robocopy Job File
::
:: The next line specifies the source directory for the operation
/SD:C:\My Files\
:: The next line is the destination directory for the operation
/DD:D:\My Backups\
:: Copy Options
/S :: This switch will copy subdirectories but not empty sub directories
/Z :: This switch will perform the operation in restartable mode
:: Excluded Files
/XF
Readme.txt :: Any file called 'Readme.txt' will not be included in the operation
*.tmp :: Any file with the extension .tmp will be excluded