Skip to main content

How to copy files in an Apache Hop workflow

What this shows​

Copy Files moves data around without opening any of it. It works on whole folders or on a pattern, it runs in a workflow rather than a pipeline, and it is usually the first or last thing a real process does: fetch the files, or publish them.

Reference documentationThe complete list of Copy Files options is documented in the Apache Hop manual, which is the authoritative reference.hop.apache.org →

Sample workflow​

The workflow in the video is workflows/copy-files-basic.hwf, in the Putki tutorial samples project.

Transcript​

Full transcript

Copy Files moves data around without opening any of it. It works on whole folders or on a pattern, it runs in a workflow rather than a pipeline, and it is usually the first or last thing a real process does: fetch the files, or publish them.

Three actions in a line. Start, the copy, and a Success to end on. The green hop means the workflow only carries on if the copy worked.

The table is a list of copy instructions, and a workflow can carry several. Each line names where to read from and where to write to. Both are folders here rather than files, which is the usual case: you rarely know in advance exactly which files will be waiting.

The wildcard is what makes it a choice rather than a sweep, and the label tells you what it expects. This is a regular expression, not the star you would type at a shell. Dot star backslash dot c s v dollar matches anything ending in dot c s v, so the folder's read-me file stays where it is.

The Settings tab decides how thorough the copy is. Include subfolders is off here, so only the top level is read. Create destination folder saves you an extra action to make the target directory, which matters the first time the workflow runs and never again.

Running the workflow walks the actions from left to right.

Three files arrived in the published folder, one for each month. The read-me that sits beside them in the source folder is not there, which is the wildcard doing its job. The panel on the left is the workflow's path: three actions, all green, in the order they ran. On a workflow with a condition in it, that list is the first thing to read.