From dc1e157eee1334eb19b5cbb874d50a653454bf6b Mon Sep 17 00:00:00 2001 From: Luca Beltrame Date: Sat, 8 May 2021 17:59:46 +0200 Subject: [PATCH] Rudimentary script to purge 389-ds backup entries --- sysadmin/purge_old_ldap.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 sysadmin/purge_old_ldap.sh diff --git a/sysadmin/purge_old_ldap.sh b/sysadmin/purge_old_ldap.sh new file mode 100644 index 0000000..a745988 --- /dev/null +++ b/sysadmin/purge_old_ldap.sh @@ -0,0 +1,14 @@ +#!/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 {} \;