09-01-2015 03:46 AM
Hello Experts,
My script is not working and i am getting below error.I am not so much good on scripts,if someone can help me i would appreciate:
----------------------------
#!/usr/bin/ksh
/usr/openv/volmgr/bin/vmquery -rn 0 -bx | grep -i scratch >/tmp/scratch.tmp
/usr/openv/volmgr/bin/vmquery -rn 1 -bx | grep -i scratch >>/tmp/scratch.tmp
/usr/openv/volmgr/bin/vmquery -rn 2 -bx | grep -i scratch >>/tmp/scratch.tmp
scratch=`cat /tmp/scratch.tmp |wc -l`
echo "Current scratch = $scratch tapes" | mailx -s "SCRATCH TAPES COUNT - $scratch count remaining" company.com
-----------------------------------------
Anyone can modify and tell me specifiaclly what i have to mention so that i will test.
Solved! Go to Solution.
09-07-2015 03:05 AM
Doesnt look like a problem with the script or with commands. It should work fine.
Do you see a problem in executing or getting the details in email. It should work if you have execute access to the script or if you are executing it as a root user.
If the proble is with execution, Please do a ls -lrt on the folder here the script is located and see if you have access to execute it.
If the problem is with mail getting delivery, check you mail log file to see if there are any issues if it was working earlier.
09-04-2015 01:21 AM
My script is not working and i am getting below error....
What is the error that you are getting?
Seems you forgot to post the error message.
Please show us output of the commands without redirecting output:
vmquery -rn 0 -bx | grep -i scratch
vmquery -rn 1 -bx | grep -i scratch
vmquery -rn 2 -bx | grep -i scratch
09-07-2015 03:05 AM
Doesnt look like a problem with the script or with commands. It should work fine.
Do you see a problem in executing or getting the details in email. It should work if you have execute access to the script or if you are executing it as a root user.
If the proble is with execution, Please do a ls -lrt on the folder here the script is located and see if you have access to execute it.
If the problem is with mail getting delivery, check you mail log file to see if there are any issues if it was working earlier.
09-10-2015 05:50 AM
Thanks all ....Its working now.
09-10-2015 05:56 AM
So - what was wrong?
What did you do to fix it?
Execute permission as suggested by Deepak?
09-10-2015 06:05 AM
Permission issue as suggested ny Deepak