#!/bin/bash set -e set -o errexit set -o nounset INSTANCE=$1 find "/var/lib/dirsrv/slapd-${INSTANCE}/bak/" \ -maxdepth 1 \ -type d \ -name "${INSTANCE}"-\* \ -mtime +7 \ -exec rm -rf {} \;