Run the collector on a schedule
Have oabo-collector push once a day with launchd, Task Scheduler, cron or a systemd timer.
What to schedule
One command, once a day: oabo-collector push. Each run sends only what changed since the last, keeps its own state in state.json, and is safe to repeat because the server replaces a day's rows rather than adding to them. There is no daemon and no background agent; the collector runs, pushes, and exits.
The installer wrote since_days = 30 into config.toml, so each run looks back 30 days and a missed day is picked up by the next run. Pick a time the machine is usually on; end of the working day works.
Note
The collector has no operating-system-specific code: the same Python command runs on macOS, Windows and Linux. Only the scheduler differs.
Schedule it
Use a launchd user agent. Save this as ~/Library/LaunchAgents/com.oabo.collector.push.plist, replacing YOUR_USER with your short user name (launchd does not expand ~).
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.oabo.collector.push</string>
<key>ProgramArguments</key>
<array>
<string>/Users/YOUR_USER/.oabo-collector/venv/bin/oabo-collector</string>
<string>push</string>
</array>
<key>StartCalendarInterval</key>
<dict>
<key>Hour</key>
<integer>18</integer>
<key>Minute</key>
<integer>30</integer>
</dict>
<key>StandardOutPath</key>
<string>/Users/YOUR_USER/.oabo-collector/push.log</string>
<key>StandardErrorPath</key>
<string>/Users/YOUR_USER/.oabo-collector/push.log</string>
</dict>
</plist>Load it and run it once now:
launchctl bootstrap gui/$(id -u) ~/Library/LaunchAgents/com.oabo.collector.push.plist
launchctl kickstart -k gui/$(id -u)/com.oabo.collector.pushA laptop asleep at 18:30 runs the job when it next wakes; launchd runs missed calendar jobs on wake.
Use Task Scheduler. From PowerShell or Command Prompt, as your own user:
schtasks /Create /SC DAILY /ST 18:30 /TN "Oabo collector push" /TR "\"%USERPROFILE%\.oabo-collector\venv\Scripts\oabo-collector.exe\" push"Run it once now and read its last result:
schtasks /Run /TN "Oabo collector push"
schtasks /Query /TN "Oabo collector push" /V /FO LISTTo see output, open Task Scheduler, find Oabo collector push, and read Last Run Result; 0x0 is success. The command writes no log of its own on Windows.
Either cron or a systemd user timer. Cron is one line in crontab -e:
30 18 * * * $HOME/.oabo-collector/venv/bin/oabo-collector push >> $HOME/.oabo-collector/push.log 2>&1A systemd user timer survives reboots with Persistent=true and keeps its output in the journal. Two files:
# ~/.config/systemd/user/oabo-collector.service
[Unit]
Description=Oabo collector push
[Service]
Type=oneshot
ExecStart=%h/.oabo-collector/venv/bin/oabo-collector push# ~/.config/systemd/user/oabo-collector.timer
[Unit]
Description=Push Oabo usage once a day
[Timer]
OnCalendar=*-*-* 18:30:00
Persistent=true
[Install]
WantedBy=timers.targetsystemctl --user daemon-reload
systemctl --user enable --now oabo-collector.timer
systemctl --user list-timers oabo-collector.timerA user timer runs only while you are logged in unless lingering is on: loginctl enable-linger $USER.
Check it ran
- On the machine:
oabo-collector statusprints the state file path, files tracked and day-keys pushed. The count grows after a successful push. - In Oabo: Settings, Connections shows the source with its last event time and event count. A source that never received anything has no last event time.
- Exit code:
0when every fingerprint group pushed cleanly,1when one was left unmarked for retry,2when the config has no credential. Task Scheduler and systemd both record it.
Expected result
The day after scheduling, Connections shows a last event time from the scheduled run and status shows more day-keys pushed.
Change the window
Set since_days in config.toml, or pass --since N after the verb (push --since 60). The option goes after push, not before it. A wider window costs a little more scanning and nothing on the server. See Options.