SFTPPlus Documentation

Start Page 4. Configuration Instructions 4.16. Local file system monitor service

4.16. Local file system monitor service

This page describes the configuration options available for the local file system monitor service.

4.16.1. General description

The local file system monitor service allows the server to monitor local file systems and emit audit log events once files or sub-directories are changed inside the monitored path.

If the configured path does not exist, the service will fail to start.

If the configured path to monitor is removed while the service is running, its content is reported as removed and the service will continue to monitor the path and wait for it to be created. The service monitor will not stop or fail.

4.16.2. Working with the source monitor

4.16.2.1. Understanding the changes poll interval

When the changes_poll_interval passes, the application will read all files, folders, and attributes (size, last modification time, etc) found in the monitored folder. Each snapshot is then compared with the previous.

If there are changes between the snapshots, they are notified to the application.

Before doing the actual notification, the application will wait for changes to be considered stable as defined by another option, stable_interval.

Note

Lower values help detect changes quicker, but increase the load, CPU, and network usage for local and remote servers.

The poll interval might drift.

For example, with a value of 72000 and a transfer started at 15:35, the product might be busy at 15:35. In this case, the check is done only at 15:36 and the next check will be scheduled for 17:36.

4.16.2.2. Changing the file stable period settings

When a new file is created or a file starts to be modified, it is not processed by SFTPPlus right away. This allows an external program to finish handling the file.

If no other changes to the file are observed after this interval, it is then processed.

Criteria for a file to be considered stable:

  • Size is not changed.
  • Last modified time attribute is not changed.
  • The configured stable interval has elapsed.

After the last modification is observed, this interval is then allowed to pass.

Each change will reset the stable interval for the file itself since each file has its own stable counter.

Since changes can only be observed with a resolution defined by changes_poll_interval, the stable_interval needs to be a multiple.

The following will check new files every hour and transfer stable files after two hours, even if the stable_interval is lower:

[transfers/b904e6a6-c29b-4ccf-8abd-edcae4d3324f]
changes_poll_interval = 3600
stable_interval = 60

4.16.3. Configuration options

Below you can find the list of available configuration options for services of the monitor type, other than the standard service configuration options.

4.16.3.1. source_path

Default value:

Disabled

Optional:

Yes

Values:
  • Absolute path on the local file system.
  • Relative path to the server installation folder.
From version:

2.10.0

To version:

None

Description:

Path to the monitored source folder.

4.16.3.2. recursive

Default value:

No

Optional:

Yes

From version:

2.10.0

Values:
  • Yes
  • No
Description:

Determines whether the monitor should look for source files and folders only in the configured path, or recurse in all its descendant folders.

4.16.3.3. changes_poll_interval

Default value:

10

Optional:

Yes

From version:

3.0.0

Values:
  • Number of seconds.
Description:

This is the time interval that defines the delay used to observe the changes in the monitored path and compare snapshots, a record of any changes, in a monitored folder.

4.16.3.4. stable_interval

Default value:

10

Optional:

Yes

From version:

2.10.0

Values:
  • Number of seconds.
Description:

This is the interval after which a file is considered stable if no changes are made to it.

4.16.3.5. source_filter

Default value:

Disabled

Optional:

Yes

From version:

2.10.0

Values:
  • Globbing expression containing wildcard characters.
  • Regular expression
  • Disabled
  • Empty
Description:

Globbing expression or regular expression used to select source files to be transferred. For more details see the matching expression documentation

Only files matching the expression will be transferred.

Only file names are filtered, all folder names will be transferred.

Leave it empty or set it to Disabled to transfer all files.

4.16.3.6. warn_non_modified_files_interval

Default value:

0

Optional:

Yes

Values:
  • Number of seconds.
From version:

3.5.0

Description:

Age in seconds after which an event is triggered for files which are not modified in that time.

A separate event is emitted for each file.

Set it to 0 to disable triggering this type of events.

Warning

This option is in the experimental stage. It might be changed in future versions in a way which is not backward compatible.