From owner-freebsd-questions@FreeBSD.ORG Sat Mar 3 09:06:32 2007 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E225516A403 for ; Sat, 3 Mar 2007 09:06:32 +0000 (UTC) (envelope-from rob_27_preston@yahoo.co.uk) Received: from web25012.mail.ukl.yahoo.com (web25012.mail.ukl.yahoo.com [217.12.10.48]) by mx1.freebsd.org (Postfix) with SMTP id 60D3E13C46B for ; Sat, 3 Mar 2007 09:06:32 +0000 (UTC) (envelope-from rob_27_preston@yahoo.co.uk) Received: (qmail 34544 invoked by uid 60001); 3 Mar 2007 09:06:31 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.co.uk; h=X-YMail-OSG:Received:Date:From:Subject:To:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-ID; b=mXM+1hpwQhpf44cojZflhC1dBe9BJVzOsUJCIDeLzhs8bQ7/VGtruOM/0RzTRy9XMfXv4V/UrsjjIe4RYQu7yd7qpFTAiQJdEZIr2J74xvfDPgDkeMHn/MU2kVLwrLGzRH+oOlLRUI44fYqBwW+wJPYHxA+NRrv3JBrvtefETu8=; X-YMail-OSG: rK_N9f0VM1nGB9njopKtCBLxnqsmcyCgaLEwTYbIxeusMncCbk2DR39qyJvPdCML88JHU2DJ4mpXHAEMp4qJoUgUbjq4JOOLADg21AI8m8z0c3XPVJ131sZGCkzFEuqvxdeC2L6GwDTxI2fC7asjqHs- Received: from [83.67.67.49] by web25012.mail.ukl.yahoo.com via HTTP; Sat, 03 Mar 2007 09:06:31 GMT Date: Sat, 3 Mar 2007 09:06:31 +0000 (GMT) From: Robert Davison To: freebsd-questions@freebsd.org MIME-Version: 1.0 Message-ID: <285897.32858.qm@web25012.mail.ukl.yahoo.com> Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: Backup Script 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, 03 Mar 2007 09:06:33 -0000 Im trying to write a small backup script which I have put in /etc/periodic/weekly. The script is as follows...... #!/bin/sh # #weekly backup of chosen files # if then tar -cf /dev/sa0 /var/ftp /home /etc /usr/local echo "backing up the disks" else echo "There was a problem" 1>&2 exit 1 fi echo "Finished at `/bin/date`." exit Now I have no experience at bash scripting as was wonderng if someone could give me some help with the if statement. Basically im trying to test to see if the machine knows that /dev/sa0 (my tape drive) is accessable. If it is then it continus to the backup, if not then it gives the error message and echos the date. Any help would be much appreciated. --------------------------------- New Yahoo! Mail is the ultimate force in competitive emailing. Find out more at the Yahoo! Mail Championships. Plus: play games and win prizes.