pre_freeze script (File System)

Important

Do not include the mount point as root '/' file system.

#!/bin/sh
#pre-freeze-script
date >> '/tmp/pre_root.log'
echo -e "\n Attempting to run pre-freeze script for File Sytem as root user\n" >> /tmp/pre_root.log
if [ "$(id -u)" -eq "0" ]; then
#### Repeate below code for multiple mount points ###
fsfreeze -f <MOUNT POINT>
if [ $? -ne 0 ]
then
  date >> '/tmp/pre_root.log'
  echo -e "\n Unable to quiesce File System\n" >> /tmp/pre_root.log
  exit 1
fi
date >> '/tmp/pre_root.log'
echo -e "\n File System is in quiesce mode now\n" >> /tmp/pre_root.log
#####################################################
else
date >> '/tmp/pre_root.log'
echo -e "not root user\n" >> '/tmp/pre_root.log'
fi

Loading...