hourctl: sync groups
List, create and change sync groups: their members, placement rules, people, rows and settings.
Every hourctl command also takes the connection options.
List sync groups, or look at and change one: its members, placement rules, people, rows and settings.
Without a subcommand, prints every group: id, domains, endpoints, number of members and sinks.
hourctl sync [OPTIONS] [COMMAND]Example:
hourctl syncCommands:
show: Show one group: its settings, endpoints, and per domain its rows and how its members stand.status: List a group’s members: their rows by domain and state, errors and pauses.create: Add a group.set: Change a group’s settings, as KEY=VALUE.delete: Remove a group.rows: List one member’s rows, and where the member is with each.resync: Send a member every row again, of one domain or all.retry: Send a member’s failed rows again, of one domain or all.resume: Take in again what a member paused by the bulk-delete guard reports.forget: Forget a device that left the group: the deletes it never confirmed stop waiting for it.placement: Show a group’s placement rules (which people go to which members), or change them.people: List the group’s people.person: Show, write or delete one person.change-id: Give a person a new user id on every member.retry-change-id: Carry on with an id change where it stopped, from that step.biometrics: Show whether a person may have biometrics in the group, or allow or refuse them.setting: Show the values a group keeps for a settings class, or set them.row: Show, write or delete one access or list row.changes: Read the change feed: every row changed after a version, deletes included.punches: Show a person’s latest punch in the group, and the few before it.
hourctl sync show
Show one group: its settings, endpoints, and per domain its rows and how its members stand.
The members are the devices the group has taken on: it takes none on until it keeps a domain, and keeps the ones it has when its domains are cleared, until they leave (the endpoint stops naming the group, or the device is blocked or forgotten).
hourctl sync show [OPTIONS] <GROUP>Arguments:
<GROUP>: The group’s id, e.g. hq.
Example:
hourctl sync show hqhourctl sync status
List a group’s members: their rows by domain and state, errors and pauses.
Prints each member’s endpoint and device, whether it is a member, its labels, its settings class, its row counts per domain and state, whether it is paused, and its last error.
hourctl sync status [OPTIONS] <GROUP>Arguments:
<GROUP>: The group’s id, e.g. hq.
Example:
hourctl sync status hqhourctl sync create
Add a group.
A group keeps the data of its domains the same on its members: the allowed devices of every endpoint that names it (hourctl endpoint set office --sync-group hq).
hourctl sync create [OPTIONS] <GROUP> [KEY=VALUE]...Arguments:
<GROUP>: The new group’s id, e.g. hq.[KEY=VALUE]...: Other settings as KEY=VALUE, e.g. people.authority=shared, people.biometrics=true or punches.lockout_minutes=5.
Options:
--domain <DOMAIN>...: A domain it keeps: people, access, lists, settings or punches; repeat for several, or separate them with commas. Without one it keeps nothing.--sink <SINK>...: A sink that is sent the group’s own events (person.*, access.*, list.*, setting.*, sync.*); repeat for several.
Example:
hourctl sync create hq --domain people --domain punches --sink payrollhourctl sync set
Change a group’s settings, as KEY=VALUE.
domains and sinks take lists separated by commas. A domain’s settings are DOMAIN.NAME: people.authority, lists.authority and settings.authority (group or shared), people.biometrics (true or false) and punches.lockout_minutes (0 for off). Access is always the group’s and has no setting: a change made at a device is not taken in.
hourctl sync set [OPTIONS] <GROUP> <KEY=VALUE>...Arguments:
<GROUP>: The group’s id, e.g. hq.<KEY=VALUE>...: The settings to change, as KEY=VALUE.
Example:
hourctl sync set hq domains=people,punches people.biometrics=truehourctl sync delete
Remove a group.
A group that keeps data is removed only with —delete-data, which deletes that data from the gateway. Nothing is deleted from devices.
hourctl sync delete [OPTIONS] <GROUP>Arguments:
<GROUP>: The group’s id, e.g. hq.
Options:
--delete-data: Delete the data the group keeps along with it.
Example:
hourctl sync delete hq --delete-datahourctl sync rows
List one member’s rows, and where the member is with each.
Prints at most 100 rows: domain, kind, key, state, the version the member applied, what comes next, what its projection leaves out, and why a row is not in sync.
hourctl sync rows [OPTIONS] <GROUP> <ENDPOINT> <DEVICE>Arguments:
<GROUP>: The group’s id, e.g. hq.<ENDPOINT>: The member’s endpoint (its id), e.g. office.<DEVICE>: The member’s serial number, e.g. CG0001.
Options:
--domain <DOMAIN>: Only this domain’s rows: people, access, lists, settings or punches.--state <STATE>: Only rows in this state: pending, in_sync, failed, unsupported, diverged, not_applicable, needs_reboot, not_placed, or deleted (a delete it confirmed).
Example:
hourctl sync rows hq office CG0001 --state failedhourctl sync resync
Send a member every row again, of one domain or all.
hourctl sync resync [OPTIONS] <GROUP> <ENDPOINT> <DEVICE>Arguments:
<GROUP>: The group’s id, e.g. hq.<ENDPOINT>: The member’s endpoint (its id), e.g. office.<DEVICE>: The member’s serial number, e.g. CG0001.
Options:
--domain <DOMAIN>: Only this domain’s rows: people, access, lists, settings or punches.
Example:
hourctl sync resync hq office CG0001 --domain peoplehourctl sync retry
Send a member’s failed rows again, of one domain or all.
A failed row waits until its row changes: nothing sends it again by itself. This puts the member’s failed rows back to be sent; its other rows are left as they are.
hourctl sync retry [OPTIONS] <GROUP> <ENDPOINT> <DEVICE>Arguments:
<GROUP>: The group’s id, e.g. hq.<ENDPOINT>: The member’s endpoint (its id), e.g. office.<DEVICE>: The member’s serial number, e.g. CG0001.
Options:
--domain <DOMAIN>: Only this domain’s rows: people, access, lists, settings or punches.
Example:
hourctl sync retry hq office CG0001 --domain peoplehourctl sync resume
Take in again what a member paused by the bulk-delete guard reports.
Look at what the device reported deleting before you resume: once resumed, what it reports is taken as for any member. A member that is not paused is left as it is.
hourctl sync resume [OPTIONS] <GROUP> <ENDPOINT> <DEVICE>Arguments:
<GROUP>: The group’s id, e.g. hq.<ENDPOINT>: The member’s endpoint (its id), e.g. office.<DEVICE>: The member’s serial number, e.g. CG0001.
Example:
hourctl sync resume hq office CG0001hourctl sync forget
Forget a device that left the group: the deletes it never confirmed stop waiting for it.
Refused for a member: take it out of the group first.
hourctl sync forget [OPTIONS] <GROUP> <ENDPOINT> <DEVICE>Arguments:
<GROUP>: The group’s id, e.g. hq.<ENDPOINT>: The device’s endpoint (its id), e.g. office.<DEVICE>: The device’s serial number, e.g. CG0001.
Example:
hourctl sync forget hq office CG0001hourctl sync placement
Show a group’s placement rules (which people go to which members), or change them.
hourctl sync placement GROUP prints the rules, numbered. Without rules everyone goes to every member; a person’s own device list (person set --device) is used instead of the rules.
hourctl sync placement [OPTIONS] <GROUP> hourctl sync placement <COMMAND>Arguments:
<GROUP>: The group’s id, e.g. hq.
Example:
hourctl sync placement hqCommands:
add: Add a rule: the people —people picks go to the members —devices picks.remove: Take rule N away, assync placement GROUPnumbers them.clear: Take every rule away: everyone goes to every member again.
hourctl sync placement add
Add a rule: the people —people picks go to the members —devices picks.
Each is a selector (docs/selectors.md): role in (lead, manager), region ^= west/nevada and not has kiosk. Without —devices the people go to every member; without —people every person goes to those members.
hourctl sync placement add [OPTIONS] <GROUP>Arguments:
<GROUP>: The group’s id, e.g. hq.
Options:
--people <SELECTOR>: Picks people by their labels.--devices <SELECTOR>: Picks members by their labels (their endpoint’s, with their own over them).
Example:
hourctl sync placement add hq --people "role = warehouse" --devices "region ^= west/nevada"hourctl sync placement remove
Take rule N away, as sync placement GROUP numbers them.
hourctl sync placement remove [OPTIONS] <GROUP> <N>Arguments:
<GROUP>: The group’s id, e.g. hq.<N>: The rule’s number, from 1.
Example:
hourctl sync placement remove hq 2hourctl sync placement clear
Take every rule away: everyone goes to every member again.
hourctl sync placement clear [OPTIONS] <GROUP>Arguments:
<GROUP>: The group’s id, e.g. hq.
Example:
hourctl sync placement clear hqhourctl sync people
List the group’s people.
Prints at most 100 people, in version order: domain, kind, user id, version, whether deleted, name, enabled and who changed them last. Pass the last VERSION shown as —after for the next page.
hourctl sync people [OPTIONS] <GROUP>Arguments:
<GROUP>: The group’s id, e.g. hq.
Options:
--after <VERSION>: Only people changed after this version.--external-id <SYSTEM:ID>: Only the people another system knows by this id, SYSTEM:ID.--select <SELECTOR>: Only the people this selector picks by their labels, e.g. “role in (lead, manager) and region ^= west”.
Examples:
hourctl sync people hqhourctl sync people hq --external-id payroll:104552hourctl sync people hq --select "role in (lead, manager)"hourctl sync person
Show, write or delete one person.
hourctl sync person [OPTIONS] <COMMAND>Commands:
show: Show a person, their credentials and where each member is with them.set: Write a person; fields not given are left as they are.delete: Delete a person from the group, and so from every member.
hourctl sync person show
Show a person, their credentials and where each member is with them.
hourctl sync person show [OPTIONS] <GROUP> <USER_ID>Arguments:
<GROUP>: The group’s id, e.g. hq.<USER_ID>: The person’s user id, e.g. 1001.
Example:
hourctl sync person show hq 1001hourctl sync person set
Write a person; fields not given are left as they are.
Scalar fields are FIELD=VALUE: name, role, enabled, valid_from, valid_to and biometrics; FIELD= clears one. keypad_pin=… and password=… are taken as FIELD=VALUE too. Cards, labels, devices and external ids have flags of their own.
hourctl sync person set [OPTIONS] <GROUP> <USER_ID> [FIELD=VALUE]...Arguments:
<GROUP>: The group’s id, e.g. hq.<USER_ID>: The person’s user id, e.g. 1001.[FIELD=VALUE]...: The fields to set, as FIELD=VALUE, or FIELD= to clear one.
Options:
--card <NUMBER>...: A card number; repeat for several. Replaces the person’s cards.--no-cards: Take all the person’s cards away.--label <KEY=VALUE>...: A label placement rules pick people by, KEY=VALUE; repeat for several. Replaces the person’s labels.--no-labels: Take all the person’s labels away.--device <ENDPOINT/DEVICE>...: A member to place the person on, ENDPOINT/DEVICE, instead of by the group’s rules; repeat for several. Replaces the list.--no-devices: Take the person’s device list away: the group’s rules place them again.--external-id <SYSTEM=ID>...: An id another system knows the person by, SYSTEM=ID; repeat for several. Replaces the person’s external ids. Never sent to a device.--no-external-ids: Take all the person’s external ids away.--pin <PIN>: The keypad PIN. Write-only: never shown.--password <PASSWORD>: The password. Write-only: never shown.--if-version <VERSION>: Only write if the person is still at this version (asperson showprinted it).
Examples:
hourctl sync person set hq 1001 name="Ana Diaz" --card 12345 --card 777 --pin 1234hourctl sync person set hq 1001 --label role=office --device office/CG0001hourctl sync person set hq 1001 --external-id payroll=104552 --external-id hr=a3f1c2e4hourctl sync person delete
Delete a person from the group, and so from every member.
hourctl sync person delete [OPTIONS] <GROUP> <USER_ID>Arguments:
<GROUP>: The group’s id, e.g. hq.<USER_ID>: The person’s user id, e.g. 1001.
Example:
hourctl sync person delete hq 1001hourctl sync change-id
Give a person a new user id on every member.
A member that cannot rename gets the person under the new id, checked, before the old one is deleted. person show shows where each member is; retry-change-id carries on where it stopped.
hourctl sync change-id [OPTIONS] <GROUP> <USER_ID> <NEW_USER_ID>Arguments:
<GROUP>: The group’s id, e.g. hq.<USER_ID>: The person’s user id now, e.g. 1001.<NEW_USER_ID>: The user id they are to have.
Options:
--allow-reenroll: Go ahead on members that may hold templates of the person the group does not have (they would have to be enrolled again).
Example:
hourctl sync change-id hq 1001 2001hourctl sync retry-change-id
Carry on with an id change where it stopped, from that step.
It stops at a failed step, or at a member refused for templates the group lacks.
hourctl sync retry-change-id [OPTIONS] <GROUP> <USER_ID>Arguments:
<GROUP>: The group’s id, e.g. hq.<USER_ID>: The person’s old user id, aschange-idwas given it.
Example:
hourctl sync retry-change-id hq 1001hourctl sync biometrics
Show whether a person may have biometrics in the group, or allow or refuse them.
This applies in any group, whatever its domains. Refusing someone allowed withdraws them: the gateway’s copies and their biometric events are deleted, and every device of the group is sent the deletes.
hourctl sync biometrics [OPTIONS] <GROUP> <USER_ID>Arguments:
<GROUP>: The group’s id, e.g. hq.<USER_ID>: The person’s user id, e.g. 1001.
Options:
--allow: Allow the person biometrics.--refuse: Refuse the person biometrics, and withdraw what there is.
Example:
hourctl sync biometrics hq 1001 --refusehourctl sync setting
Show the values a group keeps for a settings class, or set them.
The class is a member’s settings class (sync status shows it), or * for the standard names every class shares. NAME=VALUE sets a value and NAME= takes one away.
hourctl sync setting [OPTIONS] <GROUP> <CLASS> [NAME=VALUE]...Arguments:
<GROUP>: The group’s id, e.g. hq.<CLASS>: The settings class, e.g. zk-push-tft, or*(quote it in the shell).[NAME=VALUE]...: The values to set, as NAME=VALUE, or NAME= to take one away.
Examples:
hourctl sync setting hq zk-push-tfthourctl sync setting hq zk-push-tft volume=70 language=hourctl sync row
Show, write or delete one access or list row.
hourctl sync row [OPTIONS] <COMMAND>Commands:
show: Show one row.set: Write a row: the fields given, as FIELD=VALUE.delete: Delete a row from the group, and so from every member.
hourctl sync row show
Show one row.
hourctl sync row show [OPTIONS] <GROUP> <DOMAIN> <KIND> <KEY>Arguments:
<GROUP>: The group’s id, e.g. hq.<DOMAIN>: The row’s domain. One of:access(Kinds schedule, holiday, access_group and zone),lists(Kinds work_code, job_code, tip_code and message).<KIND>: The kind of row: for access schedule, holiday, access_group or zone; for lists work_code, job_code, tip_code or message.<KEY>: The row’s key within its kind, e.g. 7.
Example:
hourctl sync row show hq lists work_code 7hourctl sync row set
Write a row: the fields given, as FIELD=VALUE.
hourctl sync row set [OPTIONS] <GROUP> <DOMAIN> <KIND> <KEY> <FIELD=VALUE>...Arguments:
<GROUP>: The group’s id, e.g. hq.<DOMAIN>: The row’s domain. One of:access(Kinds schedule, holiday, access_group and zone),lists(Kinds work_code, job_code, tip_code and message).<KIND>: The kind of row: for access schedule, holiday, access_group or zone; for lists work_code, job_code, tip_code or message.<KEY>: The row’s key within its kind, e.g. 7.<FIELD=VALUE>...: The row’s fields, as FIELD=VALUE.
Options:
--if-version <VERSION>: Only write if the row is still at this version.
Example:
hourctl sync row set hq lists work_code 7 name=Packinghourctl sync row delete
Delete a row from the group, and so from every member.
hourctl sync row delete [OPTIONS] <GROUP> <DOMAIN> <KIND> <KEY>Arguments:
<GROUP>: The group’s id, e.g. hq.<DOMAIN>: The row’s domain. One of:access(Kinds schedule, holiday, access_group and zone),lists(Kinds work_code, job_code, tip_code and message).<KIND>: The kind of row: for access schedule, holiday, access_group or zone; for lists work_code, job_code, tip_code or message.<KEY>: The row’s key within its kind, e.g. 7.
Example:
hourctl sync row delete hq lists work_code 7hourctl sync changes
Read the change feed: every row changed after a version, deletes included.
Prints at most 100 rows, in version order, then next:, the version to pass as —after for the next page.
hourctl sync changes [OPTIONS] <GROUP>Arguments:
<GROUP>: The group’s id, e.g. hq.
Options:
--after <VERSION>: Only rows changed after this version.
Example:
hourctl sync changes hq --after 120hourctl sync punches
Show a person’s latest punch in the group, and the few before it.
This is what members that ask (last punch, anti-passback) are answered from. Prints the latest punch (local time, state, and the endpoint and device it was made on), then the recent ones, newest first. Kept for a group with the punches domain only.
hourctl sync punches [OPTIONS] <GROUP> <USER_ID>Arguments:
<GROUP>: The group’s id, e.g. hq.<USER_ID>: The person’s user id, e.g. 1001.
Example:
hourctl sync punches hq 1001