Document automatic sync via systemd timer
This commit is contained in:
@@ -98,6 +98,23 @@ export TIME_TRACK_DEVICE_ID="laptop-2026"
|
|||||||
|
|
||||||
Only finished entries are sent. Each completed entry receives a stable UUID. On first load after upgrading, historic entries are assigned UUIDs and the local data file is updated, so repeating a sync submits the same entry IDs for server-side idempotency. The active session is never uploaded.
|
Only finished entries are sent. Each completed entry receives a stable UUID. On first load after upgrading, historic entries are assigned UUIDs and the local data file is updated, so repeating a sync submits the same entry IDs for server-side idempotency. The active session is never uploaded.
|
||||||
|
|
||||||
|
### Automatic sync (systemd user timer)
|
||||||
|
|
||||||
|
A systemd user pair can run `sync` on a schedule:
|
||||||
|
|
||||||
|
- `time-track-sync.service` (oneshot; reads `%h/.config/time-track-sync/env` and runs `time_track.py sync`)
|
||||||
|
- `time-track-sync.timer` (every 15 minutes, `Persistent=true` to catch up after sleep)
|
||||||
|
|
||||||
|
The env file holds the same three variables as above, with mode 600. Because the client re-sends all finished entries and the server dedupes by entry UUID, resending is safe; a race with a concurrently toggling tracker can at worst skip one cycle. The timer does not upload the active session.
|
||||||
|
|
||||||
|
Useful commands:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
systemctl --user start time-track-sync.service # run a sync now
|
||||||
|
systemctl --user list-timers time-track-sync.timer # next scheduled run
|
||||||
|
journalctl --user -u time-track-sync.service -f # live logs
|
||||||
|
```
|
||||||
|
|
||||||
## Waybar behavior
|
## Waybar behavior
|
||||||
|
|
||||||
- **Left click**: start or stop a session.
|
- **Left click**: start or stop a session.
|
||||||
|
|||||||
Reference in New Issue
Block a user