OpsVault

service

Install and manage OpsVault as a systemd service.

The service commands manage OpsVault as a systemd service, so it starts automatically on boot and runs backups on schedule without any manual intervention.

service install

Write the systemd unit file, reload the daemon, and enable the service.

opsvault service install [flags]

Requires root privileges. Run with sudo if not already root.

# Install using the binary at /usr/local/bin/opsvault (default)
opsvault service install

# Install with a custom binary path
opsvault service install --binary /opt/opsvault/opsvault

Flags

FlagDefaultDescription
--binary/usr/local/bin/opsvaultPath to the opsvault binary in the unit file

What it does

  1. Renders the systemd unit file template with your binary and config paths
  2. Writes it to /etc/systemd/system/opsvault.service
  3. Runs systemctl daemon-reload
  4. Runs systemctl enable opsvault.service

After installation, start the service manually:

systemctl start opsvault

Generated unit file

[Unit]
Description=OpsVault Database Backup Service
After=network.target

[Service]
Type=simple
User=root
ExecStart=/usr/local/bin/opsvault scheduler run --config /etc/opsvault/config.yaml
Restart=on-failure
RestartSec=10s
StandardOutput=journal
StandardError=journal
SyslogIdentifier=opsvault
ProtectSystem=strict
ReadWritePaths=/var/backups/opsvault /etc/opsvault
PrivateTmp=true

[Install]
WantedBy=multi-user.target

service uninstall

Stop the service, disable it, and remove the unit file.

opsvault service uninstall

Requires root privileges. This does not delete backup files or the config file.


service start

opsvault service start
# equivalent to: systemctl start opsvault

service stop

opsvault service stop
# equivalent to: systemctl stop opsvault

When stopped via systemctl stop, a SIGTERM is sent to the process. OpsVault catches this signal and waits for any in-progress backup to finish before exiting — it will not interrupt a running dump.


service status

opsvault service status
# equivalent to: systemctl status opsvault

service logs

Stream the service logs from journald.

opsvault service logs          # recent logs
opsvault service logs -f       # follow (tail -f equivalent)

Flags

FlagDescription
-f, --followFollow log output in real time

On this page