O'Reilly logo

Linux and Unix Shell Programming by David Tansley

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

27.6. nfsdown

If you have nfs on your system you might find this script handy. I look after several machines and periodically I may have to reboot one of them during normal working hours. This usually has to be done as quickly as possible.

As I have remote directories mounted all over the place, I do not want to have to rely on the rebooting process to take care of the nfs unmounting. I would rather do it myself; besides it’s faster than letting the machine do it.

I just run the script (which is on all the machines) and all the nfs mounts get unmounted, allowing me to do a faster reboot.

The script holds a list of machines that I have nfs mounts on. A for loop loops around this list, doing a grep of each host through the df command. The nfs ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required