Date: Sun, 24 Oct 2004 18:22:40 +0200 From: Martin Schweizer <pcservi@spectraweb.ch> To: Steven J Corso <freebsd@netdtw.com> Cc: freebsd-questions@freebsd.org Subject: Re: Backing up a FreeBSD system Message-ID: <20041024162240.GA11510@saturn.pcs.ms> In-Reply-To: <20041018102125.N30190-100000@maily.netdtw.com> References: <20041018102125.N30190-100000@maily.netdtw.com>
next in thread | previous in thread | raw e-mail | index | archive | help
--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 <info@pc-service.ch> 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--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20041024162240.GA11510>