Managing Watch Folders with aswatchfolderadmin

You can use the aswatchfolderadmin utility to create, remove, and manage watch folders.

This documentation describes how to retrieve a list of watch folders, update the configuration of watch folder, and delete a watch folder. For instructions on creating a watch folder with aswatchfolderadmin utility, see Creating a Watch Folder.

The aswatchfolderadmin sub-commands used to manage watch folders require you to specify the asperawatchfolderd daemon that owns the watchfolder. To retrieve a list of daemons, you can run the query-daemons sub-command:

# /opt/aspera/bin/aswatchfolderadmin query-daemons
[aswatchfolderadmin query-daemons] Found a single daemon:

Retrieve a List of Watch Folders

Using the aswatchfolderadmin utility to configure a watch folder requires the ID of the watch folder. To retrieve a list of watch folder IDs, run the following command:

# /opt/aspera/bin/aswatchfolderadmin query-folders daemon
If you have two watch folders configured under the user root, running the query-folders sub-command may return output similar to below:
# /opt/aspera/bin/aswatchfolderadmin query-folders root
[aswatchfolderadmin query-folders] Found 2 watchfolders:

Updating a Watch Folder

To update a watch folder configuration, you must first retrieve the watch folder's configuration, make the desired changes, and then save the configuration as a JSON file. You cannot pass a new configuration file to the update-folder sub-command, because the new configuration file must match the old file exactly, except for the changes you are making. To retrieve the configuration file, run the following command:
# /opt/aspera/bin/aswatchfolderadmin query-folders daemon watch_folder_id -c

Copy the configuration into an editor and make your changes.

Note: When aswatchfolderadmin returns the JSON configuration, it obfuscates the password for the host with asterisks (******). You must enter the password again as part of your changes.
Save the file. Run the following command, specifying the modified configuration file as the JSON file:
# /opt/aspera/bin/aswatchfolderadmin update-folder daemon watchfolder_id -f json_file
For example:
# /opt/aspera/bin/aswatchfolderadmin update-folder root 3354f360-dfa6-4789-930e-074cd9d4551b -f watchfolder_conf.json
[aswatchfolderadmin update-folder] Successfully updated instance b394d0ee-1cda-4f0d-b785-efdc6496c585

Deleting a Watch Folder

To remove a watch folder, run the following command:
# /opt/aspera/bin/aswatchfolderadmin delete-folder daemon watchfolder_id
For example:
# /opt/aspera/bin/aswatchfolderadmin update-folder root 3354f360-dfa6-4789-930e-074cd9d4551b
[aswatchfolderadmin update-folder] Successfully deleted instance b394d0ee-1cda-4f0d-b785-efdc6496c585