Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 25 Sep 2000 23:23:52 -0700
From:      "Crist J . Clark" <cjclark@reflexnet.net>
To:        j mckitrick <jcm@FreeBSD-uk.eu.org>
Cc:        freebsd-questions@FreeBSD.ORG
Subject:   Re: backup problems with tar script
Message-ID:  <20000925232352.O59015@149.211.6.64.reflexcom.com>
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 %2B0100
References:  <20000926021341.A18819@dogma.freebsd-uk.eu.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20000925232352.O59015>