[BlueOnyx:07945] Re: Incremental backups

Maurice de Laat mdlaat at muisnetwerken.nl
Mon Aug 1 17:59:11 -05 2011


On Mon, Aug 01, 2011 at 11:19:16PM +0100, Richard Morgan wrote:

> Here follows a quick and dirty - no error checking and not very pretty - 
> method of keeping a few backups from raqbackup.sh on the local server:
> [snip...]

I am doing things similar, but also have a file called end.sh in the same 
location with:

#!/bin/sh

TODAY=/home/raqbackup/data
YESTERDAY=/home/raqbackup/data-1

for myfile in $YESTERDAY/*
do
  cmp $TODAY/${myfile##*/} $YESTERDAY/${myfile##*/} &> /dev/null
  if [ $? -eq 0 ]         # Test exit status of "cmp" command.
  then
    ln -f $TODAY/${myfile##*/} $YESTERDAY/${myfile##*/}
  fi
done

What this does is, if a file of the backup hasn't changed since the 
previous day, it makes it a link, thereby preserving space.

Quick and dirty. Hope it's useful.
-- 
Maurice de Laat



More information about the Blueonyx mailing list