The Aspera Watch Service (asperawatchd) is a file system change detection and snapshot service that is optimized for speed, scale, and distributed sources. On file systems that have file system notifications, changes in source file systems (new files and directories, deleted items, and renames) are detected immediately, eliminating the need to scan the file system. On file systems without file notifications, such as object storage, and AIX® file system scans are automatically triggered.
About this task
The Aspera Watch Service can be used on any local or shared (CIFS, NFS) host. However, when watching mounted shared storage and the change originates from a remote server, the Watch Service does not receive file notifications. In such cases, set <scan_period> in aspera.conf to frequent scans, such as 1 minute. See the following steps for instructions.
When used along with ascp commands, the Aspera Watch Service enables fast detection and transfer of new and deleted items. For more information about using watches with ascp, see Transferring and deleting files with the Aspera Watch Service.
To start the Aspera Watch Service and subscribe to (create) a watch:
Procedure
-
Configure a docroot or file restriction for the user.
Docroots and path restrictions limit the area of a file system or object storage to which the user has access. Users can create Watch Folders and Watch services on files or objects only within their docroot or restriction.
Note: Users can have a docroot or restriction, but not both or Watch Folder creation fails.
To set up a docroot from the command line, run the following command:
# asconfigurator -x "set_user_data;user_name,username;absolute,docroot"
Restrictions must be set from the command line:
# asconfigurator -x "set_user_data;user_name,username;file_restriction,|path"
The restriction path format depends on the type of storage. In the following examples, the restriction allows access to the entire storage; specify a bucket or path to limit access.
| Storage Type |
Format Example |
| local storage |
For Unix-like OS:
- specific folder: file:////folder/*
- drive root: file:////*
For Windows OS:
- specific folder: file:///c%3A/folder/*
- drive root: file:///c*
|
| Amazon S3 and IBM Cloud Object Storage - S3 |
s3://* |
| Azure |
azu://* |
| Azure Files |
azure-files://* |
| Alibaba Cloud |
oss://* |
| Google Cloud |
gs://* |
With a docroot or restriction setup, the user is now an Aspera transfer user. Restart asperanoded to activate your change:
Run the following commands to restart reload asperanoded:
# /etc/rc.d/init.d/asperanoded restart
-
Ensure that the user has permissions to write to the default log directory if no directory is specified.
-
Configure Watch Service settings.
Though the default values are already optimized for most users, you can also configure the snapshot database, snapshot frequency, and logging. For instructions, see
Watch Service configuration.
-
Start a Watch Service under the user.
The following command adds the Watch Service that is run under the user to the
Aspera Run Service database:
# /opt/aspera/sbin/asperawatchd --user username [options]
-
Verify that the Watch Service daemon is running under the user.
Use the aswatchadmin utility to retrieve a list of running daemons. Daemons are named for the user who runs the service.
For example, if you started a Watch Service under
root, you must see the
root daemon that is listed when you run the following command:
# /opt/aspera/bin/aswatchadmin query-daemons
[aswatchadmin query-daemons] Found a single daemon:
root
-
Create a watch.
A watch is a path that is watched by the Aspera Watch Service. To create a watch, users subscribe to a Watch Service and specify the path to watch. run the following command, where
daemon is the username that is used to start the
asperawatchd service and
filepath is the directory to watch:
# /opt/aspera/bin/aswatchadmin subscribe daemon filepath
When you create a new subscription, you can also set watch-specific logging, database, scan period, and expiration period, and override aspera.conf settings.
Note: The default scan period is 30 minutes. If you are watching a file system that does not support file system notifications (such as object storage, mounted storage (NFS), and AIX), set a more frequent scan to detect file system changes quicker.
For more information about using these options, see Managing Watch subscriptions or run:
# /opt/aspera/bin/aswatchadmin subscribe -h
Note: The default expiration for watches is 24 hours. If a watch subscription expires before the user resubscribes to it, a new subscription must be created.