From owner-freebsd-questions@FreeBSD.ORG Mon Oct 25 04:41:13 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 C39C816A4CF for ; Mon, 25 Oct 2004 04:41:13 +0000 (GMT) Received: from mail5.bluewin.ch (mail5.bluewin.ch [195.186.1.207]) by mx1.FreeBSD.org (Postfix) with ESMTP id EDEDA43D53 for ; Mon, 25 Oct 2004 04:41:12 +0000 (GMT) (envelope-from martin@saturn.pcs.ms) Received: from saturn.pcs.ms (62.203.30.41) by mail5.bluewin.ch (Bluewin AG 7.0.030.2) id 416635EF001EF2AD; Mon, 25 Oct 2004 04:41:11 +0000 Received: from saturn.pcs.ms (localhost [127.0.0.1]) by saturn.pcs.ms (8.12.11/8.12.11) with ESMTP id i9OGMsfd011637; Sun, 24 Oct 2004 18:22:54 +0200 (CEST) (envelope-from martin@saturn.pcs.ms) Received: (from martin@localhost) by saturn.pcs.ms (8.12.11/8.12.11/Submit) id i9OGMeKH011636; Sun, 24 Oct 2004 18:22:40 +0200 (CEST) (envelope-from martin) Date: Sun, 24 Oct 2004 18:22:40 +0200 From: Martin Schweizer To: Steven J Corso Message-ID: <20041024162240.GA11510@saturn.pcs.ms> Mail-Followup-To: Steven J Corso , freebsd-questions@freebsd.org References: <20041018102125.N30190-100000@maily.netdtw.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="EVF5PPMfhYS0aIcm" Content-Disposition: inline In-Reply-To: <20041018102125.N30190-100000@maily.netdtw.com> User-Agent: Mutt/1.4i Organization: PC-Service M. Schweizer GmbH, CH-8608 Bubikon, Switzerland X-PGP-Key: http://www.pc-service.ch/pgp/public_key.asc X-Fingerprint: EC21 CA4D 5C78 BC2D 73B7 10F9 C1AE 1691 D30F D239 X-Spam-Status: No, hits=-7.0 required=3.0 tests=IN_REP_TO,PGP_SIGNATURE_2,QUOTED_EMAIL_TEXT,REFERENCES, REPLY_WITH_QUOTES,USER_AGENT_MUTT version=2.55 X-Spam-Checker-Version: SpamAssassin 2.55 (1.174.2.19-2003-05-19-exp) cc: freebsd-questions@freebsd.org Subject: Re: Backing up a FreeBSD system X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Martin Schweizer List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Oct 2004 04:41:14 -0000 --EVF5PPMfhYS0aIcm Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hello Steve I copied once a week my filesystems /, /usr and /var to a second hard drive= =20 with the following cron batch (it also mailed my the important files, fstab= ,=20 dmesg.boot and disklabes): #!/bin/sh # Definition des Formates f=FCr das angeh=E4ngte Datum datum=3D`date "+%Y%m%d"` # Sendet die Disklabels /sbin/disklabel ad0 | /usr/bin/mail -s ad0_disklabel your@isp.com /sbin/disklabel ad2 | /usr/bin/mail -s ad2_disklabel your@isp.com # Sendet fstab /usr/bin/mail -s fstab your@isp.com < /etc/fstab # Sendet dmesg.boot /usr/bin/mail -s dmesg.boot your@isp.com< /var/run/dmesg.boot # L=F6schen der bestehenden Dateien /bin/rm /disk2/backup/*.dmp # Dump wird erstellt. Wenn nicht erfolgreich (-> exit codes),=20 # wird ein Mail an your@isp.com versendet /sbin/dump -0au -f /disk2/backup/usr_$datum.dmp /usr || /usr/bin/mail -s Ba= ckup-Fehler your@isp.com /sbin/dump -0au -f /disk2/backup/var_$datum.dmp /var || /usr/bin/mail -s Ba= ckup-Fehler your@isp.com /sbin/dump -0au -f /disk2/backup/root_$datum.dmp / || /usr/bin/mail -s Back= up-Fehler your@isp.com # Exitcode exit 0 Hope, this helps. Am Mon, Oct 18, 2004 at 10:30:45AM -0400 Steven J Corso schrieb: >=20 >=20 > I would like to utilize dump to back up my filesystems on a FreeBSD > machine. I happen to be utilizing FreeBSD current at this time. >=20 > I would like to do this from single user state on the system. >=20 > I have made this work, and the restore as well to another disk drive, > which is great. >=20 > However, I would like to have the system check and see if I want this to > happen at a specific time, and do the backup, and then return to > multi-user state. >=20 > I think I did this a long time ago under BSD/OS. >=20 > I did it something like this: >=20 > 1. Set a cron job to check for the existance of a file (like > want.backup). >=20 > 2. If no want.backup, do nothing >=20 > 3. If want.backup, then "init 1", backups, reboot. >=20 > There are a couple of things I can not figure out: >=20 > 1. How do you get a FreeBSD system into sigle user state and start a > shell without the prompt from init? >=20 > 2. When the system goes into single user state how do you get it to > execute a script? >=20 > Any help would be greatly appreciated. --=20 Regards Martin Schweizer PC-Service M. Schweizer GmbH; Gewerbehaus Schwarz; CH-8608 Bubikon Tel. +41 55 243 30 00; Fax: +41 55 243 33 22; http://www.pc-service.ch; public key : http://www.pc-service.ch/pgp/public_key.asc;=20 fingerprint: EC21 CA4D 5C78 BC2D 73B7 10F9 C1AE 1691 D30F D239; --EVF5PPMfhYS0aIcm Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.7 (FreeBSD) iD8DBQFBe9bQwa4WkdMP0jkRAmnaAJ0Vtm1FsRApBPWynTmRcHtH+GsjVQCg858t ch6HZcwiCsTIkzSl2hcOkxk= =YeQ+ -----END PGP SIGNATURE----- --EVF5PPMfhYS0aIcm--