From owner-freebsd-questions@FreeBSD.ORG Mon Oct 25 05:01:12 2004 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A517016A4CE for ; Mon, 25 Oct 2004 05:01:12 +0000 (GMT) Received: from auk2.snu.ac.kr (auk2.snu.ac.kr [147.46.100.32]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4B42F43D1D for ; Mon, 25 Oct 2004 05:01:12 +0000 (GMT) (envelope-from spamrefuse@yahoo.com) Received: from [147.46.44.181] (spamrefuse@yahoo.com) by auk2.snu.ac.kr (Terrace Internet Messaging Server) with ESMTP id 2004102514:00:58:491681.7481.2841316272 for ; Mon, 25 Oct 2004 14:00:58 +0900 (KST) Message-ID: <417C8894.3000704@yahoo.com> Date: Mon, 25 Oct 2004 14:01:08 +0900 From: Rob User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.7.2) Gecko/20041017 X-Accept-Language: en-us, en MIME-Version: 1.0 To: FreeBSD References: <20041018102125.N30190-100000@maily.netdtw.com> <20041024162240.GA11510@saturn.pcs.ms> In-Reply-To: <20041024162240.GA11510@saturn.pcs.ms> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-TERRACE-SPAMMARK: YES-__TRSYS_LV__3 (SR:-1.94) (SRN:SPAMROBOT) ----------------- Subject: Re: Backing up a FreeBSD system X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Oct 2004 05:01:12 -0000 Martin Schweizer wrote: > Hello Steve > > I copied once a week my filesystems /, /usr and /var to a second hard drive > with the following cron batch (it also mailed my the important files, fstab, > dmesg.boot and disklabes): > > # Löschen der bestehenden Dateien > /bin/rm /disk2/backup/*.dmp > > # Dump wird erstellt. Wenn nicht erfolgreich (-> exit codes), > # wird ein Mail an your@isp.com versendet > /sbin/dump -0au -f /disk2/backup/usr_$datum.dmp /usr || /usr/bin/mail -s Backup-Fehler your@isp.com I see a risk here, in case dump fails: you're left with nothing. Wouldn't it be better to do it in this order: /sbin/dump -0au -f /disk2/safe_backup/usr_$datum.dmp /usr if [ ]; then rm -rf /disk2/backup mv /disk2/safe_backup /disk2/backup else fi If the dump fails, you also get the error message, but now the previous dump backup is still there! Rob.