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/opsvaultFlags
| Flag | Default | Description |
|---|---|---|
--binary | /usr/local/bin/opsvault | Path to the opsvault binary in the unit file |
What it does
- Renders the systemd unit file template with your binary and config paths
- Writes it to
/etc/systemd/system/opsvault.service - Runs
systemctl daemon-reload - Runs
systemctl enable opsvault.service
After installation, start the service manually:
systemctl start opsvaultGenerated 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.targetservice uninstall
Stop the service, disable it, and remove the unit file.
opsvault service uninstallRequires root privileges. This does not delete backup files or the config file.
service start
opsvault service start
# equivalent to: systemctl start opsvaultservice stop
opsvault service stop
# equivalent to: systemctl stop opsvaultWhen 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 opsvaultservice logs
Stream the service logs from journald.
opsvault service logs # recent logs
opsvault service logs -f # follow (tail -f equivalent)Flags
| Flag | Description |
|---|---|
-f, --follow | Follow log output in real time |