- Docs
- Automations
- Automation Types
- Copy Files
Copy Files
The Copy Files automation transfers files from a selected source path to one or more destination paths. It can run on a set schedule or respond to file actions such as uploads or renames. This flexibility makes it suitable for both routine file transfers and event-based workflows across teams and systems.
Files can be copied from any folder in your site, including deeply nested subfolders, and delivered to a destination on the same site, a remote server, or a connected child site. It supports both scheduled execution and file event triggers, making it useful for distributing, organizing, or routing files without manual effort.
When to Use Copy Files Automation
Use the Copy Files automation when you need to deliver files to multiple destinations, create backups without affecting the original files, or organize content into structured folders based on time or source.
Common scenarios include distributing reports or uploads to different teams, archiving files into date-based folders for record keeping, or sending files to external SFTP servers, remote servers, or child sites. It is also useful for collecting files from remote folders, syncing data across internal systems, or staging documents for downstream processing without disrupting the source location.
Run the automation on a fixed schedule for routine transfers, or trigger it when files are uploaded or renamed for near real-time delivery. Use file renaming at the destination when you need to apply consistent naming conventions, remove draft indicators, or format filenames to match downstream system requirements. With support for dynamic paths, filters, and flexible folder structures, Copy Files fits both predictable batch workflows and responsive file handling needs.
Source Path and Folder Selection
Source paths can be on the same site, a remote server, or a child site. The source path defines where the automation will find files to copy. You can choose a specific folder, all of its immediate subfolders using /*
, or include all subfolders at any depth using /**
. For example, using invoices/*
matches folders directly under invoices
, while invoices/**
includes all folders at any level. This allows the automation to work with both flat and nested directory structures without constant updates.
When the source is a Mounted Folder or Remote Server, Automations that include glob patterns (like *
or **
) in the source path are supported only when triggered by file actions.
File Matching Rules
You can apply a file name pattern to include only specific files using wildcard expressions such as *.pdf
or **/*.csv
. These patterns enable flexible matching and allow automations to process only relevant files like reports or logs. You can also define an exclude pattern to omit certain files or folders. For example, **/*draft*
excludes all files containing the word "draft" in their name.
Wildcard patterns are matched against the selected source folder path. If a file matches the include pattern and is not excluded by the exclude pattern, the automation runs for that file. These patterns support globbing logic using wildcards to limit which files the automation should apply to.
Controlling Which Files Are Copied
You can copy all matching files or restrict the automation to only the newest ones. For example, selecting the newest 30 files ensures only recent files are copied. This is useful when working with real-time processing, bandwidth limits, or daily batch tasks. If no restriction is configured, all files under the matching path are eligible for copy.
Destination Path and Folder Structure
Destination paths can be on the same site, a remote server, or a child site. You can copy the files to one or more destinations using the same automation. Destination path supports dynamic tokens such as %Y
, %m
, and %d
for time-based folder creation. For instance, setting the destination path to /AccountingArchive/%Y/Monthly-%m-%d
will generate paths like /AccountingArchive/2025/Monthly-06-13
at runtime.
By default, folder structures from the source are preserved in the destination. If you want to merge files into a single folder, enable the option to flatten folders. This removes the original subfolder hierarchy and copies all files into the specified destination folder.
Rename and Overwrite Behavior
File names can be changed at copy time at the destination by using the Find and Replace option. This is useful for renaming status indicators like replacing _Reviewed
with _Final
. Overwrite options let you replace files at the destination if the file name matches and the sizes differ. The system skips identical-sized files by default to avoid unnecessary data transfer.
Dynamic Tokens
The destination path can include dynamic tokens. Time-related tokens such as %Y
, %m
, and %d
are replaced with the year, month, and day at runtime. Source path tokens like %p1
, %p2
, and %p3
represent folder names from the matched source path. Trigger-based tokens such as %tf
insert the name of the triggering file. These allow personalized and predictable folder and file generation during automation.
For example, you can configure a Copy Files automation to run on the 10th of every month, copying files from /AccountingAndTax/SalesTax/State/*/
that match *.pdf
, and place them in the destination folder %Y/Monthly-%m-%d
. This creates a timestamped archive like 2025/Monthly-06-10
, helping with monthly compliance and review.
Controlling How Copy Files Automations Are Executed
When triggered by file actions or webhooks, Copy Files automations may run in parallel if multiple events occur close together. This improves performance but can cause issues when working with remote mounts. Enable the Always Serialize Jobs setting to run each automation one at a time. This helps prevent file conflicts or race conditions on remote systems.