#!/bin/bashset -e set -x CLIENTS=$(echo "list clients" | bconsole | grep "-fd" | awk -F'|' '{ print $3 }' | sed 's/\ //g') for CLIENT in $CLIENTS ; do echo "pruning $CLIENT…" echo "prune jobs client=$CLIENT jobtype=backup yes" | bconsole done echo "done."