From owner-freebsd-questions Mon Sep 25 23:24: 5 2000 Delivered-To: freebsd-questions@freebsd.org Received: from mailhost01.reflexnet.net (mailhost01.reflexnet.net [64.6.192.82]) by hub.freebsd.org (Postfix) with ESMTP id DD47637B422 for ; Mon, 25 Sep 2000 23:23:57 -0700 (PDT) Received: from 149.211.6.64.reflexcom.com ([64.6.211.149]) by mailhost01.reflexnet.net with Microsoft SMTPSVC(5.5.1877.197.19); Mon, 25 Sep 2000 23:22:42 -0700 Received: (from cjc@localhost) by 149.211.6.64.reflexcom.com (8.11.0/8.11.0) id e8Q6Nqt70253; Mon, 25 Sep 2000 23:23:52 -0700 (PDT) (envelope-from cjc) Date: Mon, 25 Sep 2000 23:23:52 -0700 From: "Crist J . Clark" To: j mckitrick Cc: freebsd-questions@FreeBSD.ORG Subject: Re: backup problems with tar script Message-ID: <20000925232352.O59015@149.211.6.64.reflexcom.com> Reply-To: cjclark@alum.mit.edu References: <20000926021341.A18819@dogma.freebsd-uk.eu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0i In-Reply-To: <20000926021341.A18819@dogma.freebsd-uk.eu.org>; from jcm@FreeBSD-uk.eu.org on Tue, Sep 26, 2000 at 02:13:41AM +0100 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Tue, Sep 26, 2000 at 02:13:41AM +0100, j mckitrick wrote: > Here is a script i copied and modified from the gnu site. > I am only backing up /etc for testing reasons. > > #!/bin/csh > set now = `date` > set then = `cat ~/.admin/date.home.dump` > tar -c -l -G -v\ > -f /mnt/zip/backup.tar\ > -N "$then"\ > -V "Dump from $then to $now"\ > /etc > echo $now > ~/.admin/date.home.dump > > Here is the end of the output and the resulting error. > > etc/uucp/port.sample > etc/uucp/sys1.sample > etc/uucp/sys2.sample > tar: Can't write to (null) : Bad address > > Any ideas what is going wrong? I tried searching the tar man page for the > word 'null' in the error list, but had no luck. Apparently tar is choking > on the first file (non-directory) after all the directories in /etc. It has something to do with the '-G' option. If you take it out, you don't get the error. To be honest, I don't know what it does and the mapage is not particularly illuninating. And hmmm... the info(1) help on tar(1) is just the manpage? How un-GNU. > What I want is an automated system that backs up all files modified or > created since the last backup. I would prefer the backup file name to be > generated automatically from the date, and for the script to determine the > cutoff date automatically as well. If that's what you wanna do, #!/bin/sh # PREV_FILE=~/.admin/date.home.dump NOW=`date` LABEL=`date +%Y%m%d` PREV=`cat $PREV_FILE` tar czlvfNV /mnt/zip/etc_$LABEL.tgz "$PREV" "From $PREV to $NOW" /etc echo $NOW > $PREV_FILE But I gotta say, is your /etc really changing daily? -- Crist J. Clark cjclark@alum.mit.edu To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message