[PLUG] File test for _mounted_ CIF/SMB filesystem

Eli Stair eli.stair at gmail.com
Tue Jul 26 17:46:51 UTC 2005


Try either autofs (4.x) or just a cron job or somesuch that does
something along the lines of:

cat /proc/mounts | grep smbfs | grep $MOUNTPOINT | grep -v grep >
/dev/null  || (MOUNT COMMAND)

/eli

On 7/26/05, Roderick A. Anderson <raanders at acm.org> wrote:
> I'm looking for a slick ( one-liner? ) to test if a smbfs is mounted.
> 
> I have scripts that mount shares from Win2K servers and process data
> files.  Sometimes _stuff(s**t) happens_ and they get mounted twice or
> more.  I prefer to not leave them mounted all the time as the processing
> times are sparse.
> 
> So I'd like to test if the share is already mounted so I don't mount it
> again and if for some reason the share has been mounted multiple times I
> can umount it multiple times.
> 
> I've gone over the man pages for test and umount but nothing I tried
> worked the way I hoped.  That is just looking for the mount not testing
> for some file in the share which can be problematic.
> 
> Ideas?
> 
> 
> Thanks,
> Rod
> --
>     "Open Source Software - You usually get more than you pay for..."
>      "Build A Brighter Lamp :: Linux Apache {middleware} PostgreSQL"
> 
> 
> _______________________________________________
> PLUG mailing list
> PLUG at lists.pdxlinux.org
> http://lists.pdxlinux.org/mailman/listinfo/plug
> 


-- 
--I'm on vacation, and so is my .sig!



More information about the PLUG mailing list