Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#!/bin/bash
COUNT=0
while [ 1 ] ;do
ps -ef | grep sl[Aa]pd-$(hostname -s).pid
if [ $? -ne 0 ]; then
COUNT=$(expr ${COUNT} + 1)
echo "restart count: $COUNT"
cp -r /var/log/dirsrv/ /var/log/dirsrv.${COUNT}
find /var/log/dirsrv/ -type f -exec rm {} \;
/etc/init.d/dirsrv restart
fi
sleep 1
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.