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
_______________________________________________
Blueonyx mailing list
[email protected]
http://mail.blueonyx.it/mailman/listinfo/blueonyx

Reply via email to