From owner-freebsd-questions@FreeBSD.ORG Tue Sep 4 00:37:10 2007 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 2FB9516A418 for ; Tue, 4 Sep 2007 00:37:10 +0000 (UTC) (envelope-from maikel.lambregts@yahoo.com) Received: from smtp009.mail.ukl.yahoo.com (smtp009.mail.ukl.yahoo.com [217.12.11.63]) by mx1.freebsd.org (Postfix) with SMTP id 9061313C45D for ; Tue, 4 Sep 2007 00:37:09 +0000 (UTC) (envelope-from maikel.lambregts@yahoo.com) Received: (qmail 37077 invoked from network); 4 Sep 2007 00:10:28 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Received:X-YMail-OSG:From:To:Subject:Date:MIME-Version:Content-Type:Content-Transfer-Encoding:X-Mailer:X-MimeOLE:Thread-Index; b=O+PpRclQXxYQktbBI9U2VYDIPJTpxdSxF2tSWjF+MTRifxY03y9bR2NmQIUEK6+N/8bqIGNkav7KbfAUvr3R6LWnnpMhI3gixlen7W5Q/pBKZE7qTaGv7+oVHhzWNL5tM9HIqnPdaT2eywXbbP/HQ0bfZ3JYF2xTTe1cW+/kwfU= ; Received: from unknown (HELO ikbenstil) (maikel.lambregts@84.24.90.150 with login) by smtp009.mail.ukl.yahoo.com with SMTP; 4 Sep 2007 00:10:28 -0000 X-YMail-OSG: x1C4w0cVM1k3zY4XM3UkA0RL2C2CmgFAIACWhFvgVKbtdfv0t8ajPNtHlpZTcRwlZ.PaSRGCPA-- From: "Maikel Lambregts" To: Date: Tue, 4 Sep 2007 02:12:29 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook, Build 11.0.5510 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028 Thread-Index: AcfuiEhGBRozBjB/SaC/BXRxzmku2A== Message-Id: <20070904003709.9061313C45D@mx1.freebsd.org> X-Mailman-Approved-At: Tue, 04 Sep 2007 00:44:44 +0000 Subject: problem with running mdconfig from shell 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: Tue, 04 Sep 2007 00:37:10 -0000 Hi, I want to make automatic backup of my MySQL by using FreeBSD snapshots. All works fine when I run the commands from my Putty, but when I run them from a shell script the 2th command (mdconfig) gives an error. These are the comments to make the backup, that work fine from Putty => ======================================== /usr/local/bin/mysql -u??? -p??? -e "FLUSH TABLES WITH READ LOCK;system mksnap_ffs /usr /usr/snapshot;UNLOCK TABLES;" mdconfig -a -t vnode -f /usr/snapshot -u 4 mount -r /dev/md4 /mnt tar -cvjf /usr/home/mysqlsnapshot.tar.bz2 /mnt/home/databases umount /mnt mdconfig -d -u 4 rm -f /usr/snapshot ======================================== I get this error when I run the above from a .sh script => myserver# ./mysqlsnapshot.sh : not found mdconfig: bad unit: 4 : No such file or directory