Linux / UNIX Tech Support Forum
This is a discussion on Need help with script within the Shell scripting forums, part of the Development/Scripting category; I am currently working on setting up a shell script to monitor NAS backup disk space for your account. I ...
|
|||||||
| Shell scripting You can discuss the shell scripting, request shell scripts and scripting techniques |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
I am currently working on setting up a shell script to monitor NAS backup disk space for your account. I am completely new to scripting and linux itself so bare with me lol.
NAS Backup Server Disk Monitoring Shell Script LIMIT="17" - is it suppose to be how much space left? GETNASIP=$(host ${NASIP} | awk '{ print $4}') - Does host get replace by the IP address? Or what is the purpose of this line? Last edited by Zebrabiology; 13-04-2009 at 07:04 AM. |
| Sponsored Links | ||
|
|
|
|||
|
I also am confused with the following:
Do I choose between the two options or am I required to have both to make this script work. I can no longer find the edit button in the forums, so I am sorry that I am double posting. # Failsafe[ ! -d ${NASMNTPOINT} ] && mkdir -p ${NASMNTPOINT}mount | grep //${GETNASIP}/${NASUSER} or # if not mounted, just mount nas[ $? -eq 0 ] && : || mount -t cifs //${NASIP}/${NASUSER} -o username=${NASUSER},password=${NASPASS} ${NASMNTPOINT}cd ${NASMNTPOINT} ??? |
|
||||
|
Yes, this is warning level. If 17GB space is occupied it will send an email.
Quote:
Quote:
NASUSER="Your-User-Name" NASPASS="Your-Password" NASIP="nas.yourcorp.com" NASROOT="/username" NASMNTPOINT="/mnt/nas" EMAILID="admin@yourcorp.com" Rest will work out automatically. There is no need to modify the rest of script untie and unless you have a specific needs.
__________________
Vivek Gite Linux Evangelist |
|
|||
|
I may of found an error in the script.
I modified the NASROOT=/home, but I noticed that this variable is not being used in the script. I might of found a place that it might be used which is when the cd ${NASMNTPOINT}. Am I right? |
![]() |
| Tags |
| backup , linux , nas , shell scripting , unix |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) |
|
| Thread Tools | |
| Display Modes | |
|
|