[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: check mount



On Wed, 2013-07-17 at 10:32 +0100, Darac Marjal wrote:
> On Tue, Jul 16, 2013 at 09:32:45PM +0200, Pol Hallen wrote:
> > Hi all :-)
> > 
> > mount -t cifs //server/share /local -o [...]
> > 
> > I do this mount via vpn (over internet), How I check if this mount point
> > is active? If there's a alive connection?
> > 
> > Because (by cron) I run some scripts to do operations.
> > 
> > PS: If internet connection goes down, this mount point will not be
> > alive. How I check it?
> 
> You could try a simple "ls". The man page says:
> 
>    Exit status:
>        0      if OK,
> 
>        1      if minor problems (e.g., cannot access subdirectory),
> 
>        2      if serious trouble (e.g., cannot access command-line argument).

But if the mountpoint isn't active 'ls' will still succeed as the
directory where the mount would be is still there, all be it normally
empty.

As the reply from Erwan David says, the 'mountpoint' command does
exactly what the OP asked for.

-- 
Tixy 


Reply to: