From owner-freebsd-questions@FreeBSD.ORG Sat Jun 21 22:10:44 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 7FC241065679 for ; Sat, 21 Jun 2008 22:10:44 +0000 (UTC) (envelope-from heroh@gmx.de) Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by mx1.freebsd.org (Postfix) with SMTP id 7F66A8FC0C for ; Sat, 21 Jun 2008 22:10:43 +0000 (UTC) (envelope-from heroh@gmx.de) Received: (qmail invoked by alias); 21 Jun 2008 21:44:02 -0000 Received: from e178250229.adsl.alicedsl.de (EHLO [10.0.0.100]) [85.178.250.229] by mail.gmx.net (mp028) with SMTP; 21 Jun 2008 23:44:02 +0200 X-Authenticated: #31543762 X-Provags-ID: V01U2FsdGVkX19zFlMh6aVzIvNcJ+832ioNzHRPtl7M3RUga0NuLW Lpj6NebJiIpSGc From: Helge Rohde To: freebsd-questions@freebsd.org Date: Sat, 21 Jun 2008 21:44:09 +0000 User-Agent: KMail/1.9.7 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200806212144.09925.heroh@gmx.de> X-Y-GMX-Trusted: 0 Subject: 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: Sat, 21 Jun 2008 22:10:44 -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, 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