[comp.unix.questions] incremental backups using cpio...HOW???

bak@csd_v.UUCP (Bruce) (01/19/88)

This is article is being reposted.  It was originally cross-posted
to comp.unix.microport and both postings disappeared into bit-ether.

(BTW The last posting to ...micrport to reach this site was dated
December 30, 1987, but I just saw a posting by Plocher to ...xenix, so at
least HEe made it into the new year, even if his moderated newsgroup hasn't.)

Anyway here's my question (with apologies to any who have already seen it):

I have a problem with backups that I've never seen mentioned anywhere
on the net and I'm wondering if I'm missing some very obvious solution.

I wnat to do multi-volume incremental backups.  My version of tar
( microport 2.3 sys V ) doesn't support multi-volume archives.  So that
leaves me with cpio.

My problem is that once an archive has been created say via

$ /bin/ls /usr/bak/src | cpio -oBvc >/dev/dsk/0s25

any subsequent invocation of the same command recreates the archive
instead of adding to it.  So that if I've deleted files form /usr/bak/src
since the previous backup, I lose them forever.  Is there some way that
I can add files to a cpio created archive that I don't know about?

Thanks in advance for all help in this matter.
-- 
  Bruce Kern                                 |  uunet!swlabs!csd_v!bak  
  Computer Systems Design                    |  1-203-270-0399          
  29 High Rock Rd., Sandy Hook, Ct. 06482    |  This space for rent.    

paddock@mybest.UUCP (Steve Paddock) (01/24/88)

In article <155@csd_v.UUCP| bak@csd_v.UUCP (Bruce) writes:
|
|I have a problem with backups that I've never seen mentioned anywhere
|on the net and I'm wondering if I'm missing some very obvious solution.
|
|I wnat to do multi-volume incremental backups.  My version of tar
|( microport 2.3 sys V ) doesn't support multi-volume archives.  So that
|leaves me with cpio.
|
|My problem is that once an archive has been created say via
|
|$ /bin/ls /usr/bak/src | cpio -oBvc |/dev/dsk/0s25
|
|any subsequent invocation of the same command recreates the archive
|instead of adding to it.  So that if I've deleted files form /usr/bak/src
|since the previous backup, I lose them forever.  Is there some way that
|I can add files to a cpio created archive that I don't know about?
|
|Thanks in advance for all help in this matter.
|-- 
What I do is create a file /etc/lastbak, and touch it after each
successful backup.  I then use find / -newer /etc/lastbak -print|cpio -o[etc.]

Since I'm using a 6300 Plus, not uPort, I use cpiopc to get the actual
multivolume cpio archive.  

Problem with this approach is that you may well have a fit problem
if you do a full restore.

davidsen@steinmetz.steinmetz.UUCP (William E. Davidsen Jr) (01/26/88)

In article <252@mybest.UUCP> paddock@mybest.UUCP (Steve Paddock) writes:
| In article <155@csd_v.UUCP| bak@csd_v.UUCP (Bruce) writes:
| |
| |I have a problem with backups that I've never seen mentioned anywhere
| |on the net and I'm wondering if I'm missing some very obvious solution.
| |......
|
| What I do is create a file /etc/lastbak, and touch it after each
| successful backup.  I then use find / -newer /etc/lastbak -print|cpio -o[etc.]

I would recommend that you do the following:
	1. touch another file, such a this bak
	2. do the backup using the -newer lastbak
	3. mv thisbak lastbak
There are some windows in using only one file which are undesirable in
an active system.
-- 
	bill davidsen		(wedu@ge-crd.arpa)
  {uunet | philabs | seismo}!steinmetz!crdos1!davidsen
"Stupidity, like virtue, is its own reward" -me

lyndon@ncc.UUCP (Lyndon Nerenberg) (01/27/88)

This is a Q&D hack I've used for quite some time...

#!/bin/sh
cd /usr/src
find . -type f -a -newer /etc/local/lastinc -print | cpio -oacvQ /dev/rmt0
touch /etc/local/lastinc
exit 0

This isn't perfect, but it's very painless. It *does* require the
use of multiple tapes (disks) for each incremental, but then again,
so would tar.

--lyndon

davidsen@steinmetz.steinmetz.UUCP (William E. Davidsen Jr) (02/10/88)

In article <10048@ncc.UUCP> lyndon@ncc.UUCP (Lyndon Nerenberg) writes:
| 
| This is a Q&D hack I've used for quite some time...
| 
| #!/bin/sh
| cd /usr/src
| find . -type f -a -newer /etc/local/lastinc -print | cpio -oacvQ /dev/rmt0
| touch /etc/local/lastinc
| exit 0

The problem with this is that there is a window in which a file may
change after being backed up and before the bulkhead file is touched. I
was bitten by this (just) once and use:
	touch marker.new
	find /u -newer marker -print | cpio -oBc > /dev/whatever
	mv marker marker.old && mv marker.new marker

Obviously I had to create the original marker file with touch, then do a
backup of some kind.
-- 
	bill davidsen		(wedu@ge-crd.arpa)
  {uunet | philabs | seismo}!steinmetz!crdos1!davidsen
"Stupidity, like virtue, is its own reward" -me