From owner-freebsd-questions Tue Sep 18 7:51: 8 2001 Delivered-To: freebsd-questions@freebsd.org Received: from smartwall.thebeaconjournal.com (smartwall.thebeaconjournal.com [204.210.192.10]) by hub.freebsd.org (Postfix) with ESMTP id F0E2937B40E for ; Tue, 18 Sep 2001 07:49:27 -0700 (PDT) Received: by smartwall.thebeaconjournal.com; id KAA10020; Tue, 18 Sep 2001 10:45:29 -0400 (EDT) Received: from unknown(166.108.139.2) by smartwall.thebeaconjournal.com via smap (V4.2) id xma009960; Tue, 18 Sep 01 10:44:50 -0400 Received: from [206.128.102.10] ([206.128.102.10]) by bea-mx.thebeaconjournal.com (Netscape Messaging Server 4.15) with ESMTP id GJV5M900.OP3; Tue, 18 Sep 2001 10:58:57 -0400 Mime-Version: 1.0 X-Sender: jarnold@krcoms1.knightridder.com Message-Id: In-Reply-To: <3.0.5.32.20010917211717.06b79c98@mail.sage-american.com> References: <3.0.5.32.20010917211717.06b79c98@mail.sage-american.com> Date: Tue, 18 Sep 2001 10:46:40 -0400 To: jacks@sage-american.com, freebsd-questions@freebsd.org From: Jim Arnold Subject: Re: FS backup to Hard Disk Content-Type: text/plain; charset="us-ascii" ; format="flowed" Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG I use the little program below on my box. it's a server with a drive dedicated to just backing up the main disk. it's easy and works very well. jim ========== #!/bin/sh # full and incr backup script # created 27 Sep 99 # Based on a script by Daniel O'Callaghan #Change the 5 variables below to fit your computer/backup COMPUTER=hogan # name of this computer DIRECTORIES="/etc /www /usr/local /var/named /var/log" # directoris to backup BACKUPDIR=/deskstar/backups # where to store the backups TIMEDIR=/deskstar/backups/last-full # where to store time of full backup TAR=/bin/tar # name and locaction of tar #You should not have to change anything below here PATH=/usr/local/bin:/usr/bin:/bin DOW=`date +%a` # Day of the week e.g. Mon DOM=`date +%d` # Date of the Month e.g. 27 DM=`date +%d%b` # Date and Month e.g. 27Sep # On the 1st of the month a permanet full backup is made # Every Sunday a full backup is made - overwriting last Sundays backup # The rest of the time an incremental backup is made. Each incremental # backup overwrites last weeks incremental backup of the same name. # # if NEWER = "", then tar backs up all files in the directories # otherwise it backs up files newer than the NEWER date. NEWER # gets it date from the file written every Sunday. if [ $DOM = "01" ]; then # monthly full backup NEWER="" $TAR $NEWER -z -c -f $BACKUPDIR/$COMPUTER-$DM.tgz $DIRECTORIES fi if [ $DOW = "Sun" ]; then # weekly full backup NEWER="" NOW=`date +%d-%b` echo $NOW > $TIMEDIR/$COMPUTER-full-date #update full backup date $TAR $NEWER -z -c -f $BACKUPDIR/$COMPUTER-$DOW.tgz $DIRECTORIES else #make incremental backup - overwrite last weeks NEWER="--newer `cat $TIMEDIR/$COMPUTER-full-date`" #get date of last full backup $TAR $NEWER -z -c -f $BACKUPDIR/$COMPUTER-$DOW.tgz $DIRECTORIES fi ========= >I would like to do nitely cron backup everything for full restore to a >second hard disk: >/mnt/fat32/backupdir > >I gather I need to use "tar" to do this, but not exactly sure of the >precise command and switches. Don't want to mess up on this. Here's my fstab: > >Filesystem 1K-blocks Used Avail Capacity Mounted on >/dev/ad0s2a 99183 29641 61608 32% / >/dev/ad0s2f 8835083 673328 7454949 8% /usr >/dev/ad0s2e 19815 2317 15913 13% /var >procfs 4 4 0 100% /proc >/dev/ad1s1 13264736 3086024 10178712 23% /mnt/fat32 > >Guidance on exact tar line command would be appreciated.... thanks in >advance. > >Best regards, >Jack L. Stone, >Server Admin > >Sage-American >http://www.sage-american.com >jacks@sage-american.com > >To Unsubscribe: send mail to majordomo@FreeBSD.org >with "unsubscribe freebsd-questions" in the body of the message -- ___________________________________________________________ Jim Arnold Voice: 330.253.9524 x 9-12 Ohio.com Site Administrator Fax: 330.253.8214 http://www.ohio.com Cell: 330.730.0797 AOL IM: instantjim 12 E. Exchange Street - 2nd Fl -- Akron, OH 44308 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message