From owner-freebsd-questions@FreeBSD.ORG Sun Jun 22 06:49:37 2008 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ACBA61065675 for ; Sun, 22 Jun 2008 06:49:37 +0000 (UTC) (envelope-from wojtek@wojtek.tensor.gdynia.pl) Received: from wojtek.tensor.gdynia.pl (wojtek.tensor.gdynia.pl [IPv6:2001:4070:101:2::1]) by mx1.freebsd.org (Postfix) with ESMTP id CC8DB8FC12 for ; Sun, 22 Jun 2008 06:49:36 +0000 (UTC) (envelope-from wojtek@wojtek.tensor.gdynia.pl) Received: from wojtek.tensor.gdynia.pl (localhost [IPv6:::1]) by wojtek.tensor.gdynia.pl (8.14.2/8.14.2) with ESMTP id m5M6nT6N004294; Sun, 22 Jun 2008 08:49:29 +0200 (CEST) (envelope-from wojtek@wojtek.tensor.gdynia.pl) Received: from localhost (wojtek@localhost) by wojtek.tensor.gdynia.pl (8.14.2/8.14.2/Submit) with ESMTP id m5M6nShO004291; Sun, 22 Jun 2008 08:49:28 +0200 (CEST) (envelope-from wojtek@wojtek.tensor.gdynia.pl) Date: Sun, 22 Jun 2008 08:49:28 +0200 (CEST) From: Wojciech Puchar To: Helge Rohde In-Reply-To: <200806212144.09925.heroh@gmx.de> Message-ID: <20080622084815.N4272@wojtek.tensor.gdynia.pl> References: <200806212144.09925.heroh@gmx.de> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: freebsd-questions@freebsd.org Subject: Re: shellscript conditional to check for external disk X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Jun 2008 06:49:37 -0000 > 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, won't disappear on disconnect? strange. you may add something to devd.conf - so your script will be started on attach.