#!/bin/bash# Dump and commit the list of servicegroups to the repository at# ~/var/lib/git/servicegroups hourly for backup and history.# Abort on error.set-e# Loop forever.whiletrue;doTMPWC="$(mktemp-d)"gitclone~/var/lib/git/servicegroups"$TMPWC"cd"$TMPWC"ldaplist-lservicegroups>servicegroups.ldifgitaddservicegroups.ldififgitcommit-mSnapshot;thengitpushficdrm-Rf"$TMPWC"# Sleep for an hour.sleep1hdone