pre_freeze script (PostgreSQL)

#!/bin/sh
#pre-freeze-script
date >> '/scripts/pre_root.log'
echo -e "\n attempting to run pre-freeze script for PostgrSQL as root user\n" >> /scripts/pre_root.log
if [ "$(id -u)" -eq "0" ]; then
python '/scripts/quiesce.py'
if [ $? -ne 0 ]
then
echo -e "\n Unable to quiesce PostgrSQL DB\n" >> /scripts/pre_root.log
exit 1
fi
echo -e "\n Database is in quiesce mode now\n" >> /scripts/pre_root.log
else
date >> '/scripts/pre_root.log'
echo -e "not root user\n" >> '/scripts/pre_root.log'
fi

Loading...