Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 21 Jun 2008 21:44:09 +0000
From:      Helge Rohde <heroh@gmx.de>
To:        freebsd-questions@freebsd.org
Subject:   shellscript conditional to check for external disk
Message-ID:  <200806212144.09925.heroh@gmx.de>

next in thread | raw e-mail | index | archive | help
Hello List,

I need to write a backup script, and one of the required actions would be a 
copy of the backup to an external firewire drive. I would like to make this 
as easy as possible for the local staff, so i'd like to check whether the 
drive is attached, if necessary mount it, copy over the backup  and unmount 
it again, so that the local staff can swap the external disks when they're 
not used.
 
Is there a canonical way to achieve what i want? I played with the idea of 
simply checking for /dev/da0s1d's existance, but that won't disappear on 
disconnect, so that would leave the  is a possibility that although da0 is 
in /dev, it might not be connected.

Any ideas or RTFM-pointers?

Helge



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200806212144.09925.heroh>