hubio-sync service

Install, manage, and control hubio-sync as a system service.

Synopsis

hubio-sync service <subcommand> [flags]

Description

The service command group manages hubio-sync as a system service that runs in the background, automatically starting on boot and executing scheduled migrations.

Platform Support

PlatformService ManagerPrivileges Required
macOSlaunchd (LaunchAgent)None (user-level)
LinuxsystemdRoot/sudo
WindowsWindows Service Control ManagerAdministrator

Subcommands

SubcommandDescription
installInstall as a system service
uninstallRemove the service
statusShow service status
startStart the service
stopStop the service
restartRestart the service
logsView service logs

hubio-sync service install

Install hubio-sync as a system service.

Synopsis

hubio-sync service install [flags]

Flags

FlagDescription
--startStart the service immediately after installation
--userUser to run the service as (Linux only)

Description

Installs hubio-sync as a system service configured to:

  • Start automatically on system boot
  • Restart automatically on failure
  • Run the serve --daemon command

Examples

# Install service
hubio-sync service install

# Install and start immediately
hubio-sync service install --start

# Install with specific user (Linux)
sudo hubio-sync service install --user hubio

Output

hubio Sync Service Installation
================================
Platform: darwin/arm64

Installing service...
  Name: com.hubio.sync
  Executable: /usr/local/bin/hubio-sync
  Arguments: [serve --daemon]
  Auto-start: true

Service installed successfully!

LaunchAgent plist: ~/Library/LaunchAgents/com.hubio.sync.plist
Logs: ~/Library/Logs/hubio-sync/

To start the service, run: hubio-sync service start

Platform Details

macOS:

  • Installed as user-level LaunchAgent
  • No root privileges required
  • Plist location: ~/Library/LaunchAgents/com.hubio.sync.plist
  • Logs: ~/Library/Logs/hubio-sync/

Linux:

  • Installed as systemd user or system service
  • Requires root/sudo privileges
  • Unit file: /etc/systemd/system/hubio-sync.service or ~/.config/systemd/user/
  • Logs: journald (journalctl -u hubio-sync)

Windows:

  • Registered with Windows Service Control Manager
  • Requires Administrator privileges
  • Visible in services.msc
  • Logs: %LOCALAPPDATA%\hubio-sync\logs\

hubio-sync service uninstall

Remove the hubio-sync service.

Synopsis

hubio-sync service uninstall

Description

Stops the service if running and removes the service configuration. The hubio-sync binary and configuration files are not removed.

Example

hubio-sync service uninstall

Output

hubio Sync Service Uninstallation
==================================

Removing service...
Service uninstalled successfully!

hubio-sync service status

Show the current status of the hubio-sync service.

Synopsis

hubio-sync service status

Example

hubio-sync service status

Output (Service Running)

hubio Sync Service Status
=========================

Platform: darwin/arm64
Status: Installed
State: Running
PID: 12345
Started: 2025-12-03 14:30:00

Service config: ~/Library/LaunchAgents/com.hubio.sync.plist

Logs
----
Log file: ~/Library/Logs/hubio-sync/daemon.log

View logs:
  tail -f ~/Library/Logs/hubio-sync/daemon.log

Output (Service Not Installed)

hubio Sync Service Status
=========================

Platform: darwin/arm64
Status: Not installed

To install, run: hubio-sync service install

hubio-sync service start

Start the hubio-sync service.

Synopsis

hubio-sync service start

Example

hubio-sync service start

Output

Starting service...
Service started successfully!

Platform Commands

Under the hood, this runs:

  • macOS: launchctl load ~/Library/LaunchAgents/com.hubio.sync.plist
  • Linux: systemctl start hubio-sync
  • Windows: sc start hubio-sync

hubio-sync service stop

Stop the hubio-sync service.

Synopsis

hubio-sync service stop

Example

hubio-sync service stop

Output

Stopping service...
Service stopped successfully!

hubio-sync service restart

Restart the hubio-sync service.

Synopsis

hubio-sync service restart

Description

Stops the service if running, then starts it again. Useful after configuration changes.

Example

hubio-sync service restart

Output

Stopping service...
Starting service...
Service restarted successfully!

hubio-sync service logs

View hubio-sync service logs.

Synopsis

hubio-sync service logs [flags]

Flags

FlagShortDefaultDescription
--follow-ffalseFollow log output (like tail -f)
--lines-n50Number of lines to show

Examples

# Show last 50 lines
hubio-sync service logs

# Show last 100 lines
hubio-sync service logs -n 100

# Follow logs in real-time
hubio-sync service logs -f

# Follow with 20 initial lines
hubio-sync service logs -f -n 20

Output

Log file: ~/Library/Logs/hubio-sync/daemon.log

2025-12-03T14:30:00Z INFO  Starting hubio-sync scheduler daemon
2025-12-03T14:30:00Z INFO  Loading configuration from ~/.config/hubio-sync/config.json
2025-12-03T14:30:00Z INFO  Loaded 3 scheduled jobs
2025-12-03T14:30:00Z INFO  Scheduler started, waiting for scheduled jobs...
2025-12-03T15:00:00Z INFO  Executing scheduled job: hourly-sync
2025-12-03T15:00:05Z INFO  Job completed: hourly-sync (duration: 5.2s)

Platform-Specific Behavior

Linux (systemd): Uses journalctl to read from systemd journal:

journalctl -u hubio-sync -n 50 -f

macOS: Uses tail to read from log file:

tail -n 50 -f ~/Library/Logs/hubio-sync/daemon.log

Windows: Uses PowerShell Get-Content:

Get-Content $env:LOCALAPPDATA\hubio-sync\logs\daemon.log -Tail 50 -Wait

Complete Workflow

Install and Start Service

# 1. Install the service
hubio-sync service install

# 2. Start it
hubio-sync service start

# 3. Verify it's running
hubio-sync service status

# 4. Watch the logs
hubio-sync service logs -f

One-Liner

hubio-sync service install --start && hubio-sync service logs -f

Update Service After Config Change

# Make changes in GUI or config file, then:
hubio-sync service restart

Remove Service

hubio-sync service uninstall

See Also