Re-mount CIFS share only if not mounted?
Hi,
I have an Ubuntu 16 system that always needs to have a handful of Samba shares mounted.
I put "mount -a" into a cronjob, just in case there was a network problem, and those samba-mounts have been lost/umounted for some network-reason.
But now i noticed, when i excecute just "mount" without any arguments, that those shares are mounted like a hundred times. The output is huge.
Cause everytime "mount -a" is running via cron, its generating new lines there. Making it look as if those shares are mounted plenty of the times in the same way.
It does not seem to make a problem right now. But i could imagine that some buffer or limit will be reached some day with this. And it does not appear to be very clean.
Is there a proper way to do this?
Of course i could do an umount -a , and then mount -a . But this would break connection to those samba shares of course.
Is there no way to re-mount them, just if they are currently NOT mounted?
Regards,
ND
Last edited by NDev; 05-05-2018 at 06:39 AM.
|