#!/bin/sh with_service() { svc=$1 shift s6-svc -wR -u "/var/run/s6/services/${svc}" s6-setuidgid "$svc" $@ s6-svc -d "/var/run/s6/services/${svc}" } set -x echo backup influxdb with_service "influxdb" backup-influxdb echo backup postgres with_service "postgres" backup-postgres