shell-sh脚本:如果没有挂载,如何挂载远程文件系统?

前端之家收集整理的这篇文章主要介绍了shell-sh脚本:如果没有挂载,如何挂载远程文件系统?前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
在bourne shell脚本(#!/ bin / sh)中,如何检查是否已挂载远程NFS共享,如果未挂载,则挂载它?我现在有一套丑陋的猫,greps和ifs使用’mount’的输出,但它似乎没有做可靠的工作.
如果可能,设置automount(autofs)将是执行此操作的标准方法.它可能已经在您的发行版中(附带CentOS / Redhat默认安装). Here is a tutorial.

为什么要使用Automount?

Automounting is the process where mounting and unmounting of certain filesystems is done automatically by a daemon. If the filesystem is unmounted,and a user attempts to access it,it will be automatically (re)mounted. This is especially useful in large networked environments and for crossmounting filesystems between a few machines (especially ones which are not always online).

猜你在找的Bash相关文章