M
Mduduzijnr
Guest
Good day everyone
kindly assist I`m new on the Linux o/s and i have been given a task to have or write a script to check if mount points on our Linux server are available as we getting an alert every time. My aim is to have a script that will check every second and if the mount is there and it should do nothing but when the mount is in a stale file handle it should umount and mount it back.
i have come up with this so far.
#!/bin/bash
read -r -t1 < <(stat -t "/opt/hcap/storage")
if [ $? -eq 1 ]; then
echo NFS mount stale. Removing...
umount -f -l /opt/hcap/storage
fi
kindly assist I`m new on the Linux o/s and i have been given a task to have or write a script to check if mount points on our Linux server are available as we getting an alert every time. My aim is to have a script that will check every second and if the mount is there and it should do nothing but when the mount is in a stale file handle it should umount and mount it back.
i have come up with this so far.
#!/bin/bash
read -r -t1 < <(stat -t "/opt/hcap/storage")
if [ $? -eq 1 ]; then
echo NFS mount stale. Removing...
umount -f -l /opt/hcap/storage
fi