#!/bin/bash
### storage checking shell scripts ###
# global variable
nfs_file_first=`/bin/df |grep -i 14.0.86.60`
# first storage checking
if [ "$nfs_file_first" == "" ]; then
echo "nfs mount is not confirmed.. start nfs mount"
/bin/mount -t nfs 14.0.86.60:/data /storage -o nolock,tcp,soft,noatime,nodiratime,rsize=16384,wsize=16384
else
echo "nfs mount is already done.."
fi
### 구성요소
# nfs 서버 확인
# nfs_file_first 가 null 이면 아래의 nfs mount 명령어 실행
# 해당값이 있으면 메시지 찍은후 if문 종료
### 해당 스크립트를 cron에 1분정도로 해서 필요한 서버에 걸어 놓으면 됨
'IT Study > script' 카테고리의 다른 글
nfs를 이용한 간단한 백업 스크립트 (0) | 2016.02.19 |
---|---|
tomcat 프로세스 재구동 스크립트 (0) | 2016.02.19 |
서버 스크립트 자동 배포 (0) | 2014.10.21 |
perl ssh 원격 명령 스크립트 (0) | 2014.10.21 |
ssh원격 접속 명령 (0) | 2014.10.21 |