AIX 6/7 Script to create a file with commands to remove missing and failed paths

To create a file with commands to remove the missing paths

1
2
3
4
5
6
7
8
9
#!/bin/sh
# rmpaths
>xrmpaths
echo "#!/bin/sh" >>xrmpaths
disks=$(lspv | awk '{print $1}')
for loop in $disks
do
lspath -l $loop -H -F "name:parent:connection:status" |grep Missing| awk -F: '{print "rmpath -dl",$1,"-p", $2, "-w", $3}'>>xrmpaths
done

 

To create a file with commands to remove the failed paths

1
2
3
4
5
6
7
8
9
#!/bin/sh
# rmpaths
>xrmpaths
echo "#!/bin/sh" >>xrmpaths
disks=$(lspv | awk '{print $1}')
for loop in $disks
do
lspath -l $loop -H -F "name:parent:connection:status" |grep Failed| awk -F: '{print "rmpath -dl",$1,"-p", $2, "-w", $3}'>>xrmpaths
done
5 (1)
Article Rating (1 Votes)
Rate this article
Attachments
There are no attachments for this article.
Comments
There are no comments for this article. Be the first to post a comment.
Full Name
Email Address
Security Code Security Code
Related Articles RSS Feed
Using Shell Redirection: All About the Here-Doc
Viewed 10071 times since Wed, May 30, 2018
AIX Different Commands For Paging Space Administration swap file create
Viewed 7172 times since Thu, Aug 1, 2019
Unlock User ID in IBM AIX
Viewed 14713 times since Mon, May 28, 2018
Install and configure GNU watch (gwatch) on AIX
Viewed 7561 times since Thu, Feb 21, 2019
How To Mirror Your Root Disk On AIX (a.k.a. rootvg)
Viewed 4936 times since Mon, May 21, 2018
AIX boot proccess
Viewed 2710 times since Tue, Apr 16, 2019
0516-787 extendlv: Maximum allocation for logical volume error
Viewed 8397 times since Tue, Mar 12, 2019
Trouble Shooting AIX Networking
Viewed 2392 times since Tue, May 22, 2018
Install and configure yum on AIX
Viewed 4353 times since Thu, Feb 21, 2019
Many Choices for AIX File Integrity
Viewed 2517 times since Wed, May 30, 2018