| Watch Folders and the Aspera Watch Service |
217
Creating a Subscription, Snapshots, and Snapshot Differential
1.
Create a subscription and decide how to manage its expiration.
# /opt/aspera/bin/aswatchadmin subscribe
daemon
filepath
[
options
]
By default, subscriptions expire in 24 hours. If your snapshot comparisons will be spaced more than 24
hours apart, either set the expiration time to a duration longer than the time between snapshots (add
--
expire_in=
seconds
to the command) or send a resubscribe command periodically to maintain the
subscription.
For more information on creating subscriptions and resubscribing to them, see
on
page 215.
In the following example, user
aspera
subscribes to
/projectA/source
and the subscription expires in 48 hours:
# /opt/aspera/bin/aswatchadmin subscribe aspera /projectA/source --
expire_in=172800
[aswatchadmin subscribe] Successfully created
subscription {"identifier":"bec581b3-3c34-47d7-
a719-93f26f8272d1","path":"file:////projectA/source","scan_period":
{"sec":9223372036854775807,"usec":999999},"expiration":"2018-03-15T07:39:21Z"}
Record the subscription ID (the value of "identifier" in the output) for use in creating the snapshot. You can also
retrieve the subscription ID later.
2.
Create a snapshot.
# /opt/aspera/bin/aswatchadmin create-snapshot
daemon
subscription_id
If you do not have the subscription ID, run the following command:
# /opt/aspera/bin/aswatchadmin query-subscriptions
daemon
In the following example, user
aspera
creates a snapshot of the directory that is watched by subscription
bec581b3-3c34-47d7-a719-93f26f8272d1
:
# /opt/aspera/bin/aswatchadmin create-snapshot aspera bec581b3-3c34-47d7-
a719-93f26f8272d1
[aswatchadmin create-snapshot] Successfully created snapshot 1.
3.
After the desired interval, create another snapshot to compare with the previous snapshot.
The snapshot ID is automatically incremented with each
create-snapshot
command. For example, running
the same command as the previous step outputs a new snapshot:
# /opt/aspera/bin/aswatchadmin create-snapshot aspera bec581b3-3c34-47d7-
a719-93f26f8272d1
[aswatchadmin create-snapshot] Successfully created snapshot 2.
4.
Generate the snapshot differential between the most recent snapshot and the snapshot before it.
To create a snapshot differential that outputs a list that can be used by
ascp
, run the following command:
# /opt/aspera/bin/aswatchadmin snapshot-
differential
daemon
subscription_id
snapshot_id
--format=PATH
Where the snapshot ID is the latest snapshot. For example:
# /opt/aspera/bin/aswatchadmin snapshot-differential aspera
bec581b3-3c34-47d7-a719-93f26f8272d1 2
/new_file.png