Transfers are the pro-active component of SFTPPlus. While a file transfer service only acts in response to requests from remote clients, transfers actively check local or remote paths and initiate transfer based on changes in those folders.
Transfers are executed by transferring files between a source location and a destination location.
Source location changes are detected by regularly checking the source folder for changes.
When a change is observed on the monitored source location, the monitor emits one of the following event types:
Here is a list of file system changes which are ignored:
For transfers of type Local filesystem only, created, moved, or removed folders will only emit an informational log event, without triggering the prior transfer command. The same behaviour is present when a file is removed.
For transfers of type other than Local filesystem only, folder events and file removed event are ignored, and no informational event is emitted.
Source events are observed only inside the configured path, and the server will ignore events outside the configured path. While in most cases this is the desired result, it affects ‘moved’ events. Moved events are only observed inside the location path. When you move a file from a path outside the monitored path, a create event is emitted. When you move a file to a path outside the monitored path, a delete event is emitted.
A transfer can monitor only direct ancestors of a folder, for non-recursive monitors, or all ancestors for recursive ones.
When the source location is not available (for example its connection failed after all retries) the transfer will become stalled and no files will be transfered.
The destination’s locations are accessed only when a file which needs to be transferred is detected on the source location.
When the destination location is not available the changes detected on the source location are still observed but no transfer is attempted. As soon as the destination location is available again, new changes observed on the destination will be processed.
A transfer can be in one of the following states:
A location can be in one of the following states:
Hard links and symbolic links are observed as normal files.
When both the link and original are monitored, changes to the link will trigger notifications for the original file as well as any other hard links pointing to it.
When only the link is monitored, changes to the original source will also trigger notifications.
When an event occurs at the source location, it is not signalled right away. A buffer time interval is used to remove duplicate events and emit the event only once the file or folder is stable.
For example, when a large file is copied, the operating system will emit a stream of events after each intermediary change. The monitor will queue these changes and merge them into a single event.
The time frame in which duplicate events are resolved is 1 second. After an event occurs, it waits 1 second before emitting the event. If no event occurs for the same source, the event is emitted. Otherwise, the event is merged and the time interval is extended by another second in which it can be further merged with another event, or emitted.
Here are the rules based on which events are resolved: