cancel
Showing results for 
Search instead for 
Did you mean: 

Script not working for scratch tapes in library having TLD0,TLD1 and TLD2

2013
Level 5

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.

 

 

1 ACCEPTED SOLUTION

Accepted Solutions

Deepak_G
Level 6
Certified

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.

 

 

 

View solution in original post

5 REPLIES 5

Marianne
Level 6
Partner    VIP    Accredited Certified

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 

Deepak_G
Level 6
Certified

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.

 

 

 

2013
Level 5

Thanks all ....Its working now.

Marianne
Level 6
Partner    VIP    Accredited Certified

So - what was wrong?

What did you do to fix it?
Execute permission as suggested by Deepak?

2013
Level 5

Permission issue as suggested ny Deepak