On Fri, Dec 23, 2005 at 02:43:29PM -0600, L. V. Lammert wrote:
| The biggest disadvantage is that you're maintaining a single remote copy;
| if you wish more than one historical version you must manage separately.
Check out the --link-dest option to rsync. Consider the following
snippet of a shell script I'm writing :
----------------------------------------------------------------------
...
for USER in $(cat ${USERSFILE})
do
SRC=${BACKUPPREFIX}/${USER}/
if [ ! -d ${SRC} ]
then
echo Source not found \(${SRC}\) >&2
exit 3
fi
DST=${STOREPREFIX}/${NOW}/${USER}
mkdir -p ${DST}
PREVDIR=${STOREPREFIX}/${PREVIOUS}/${USER}
if [ -d ${PREVDIR} ]
then
rsync -aHx --link-dest=${PREVDIR} ${SRC} ${DST}
else
rsync -aHx ${SRC} ${DST}
fi
done
...
----------------------------------------------------------------------
I use the above for a local disk backup (to cover users accidentally
deleting their files or one of the disks failing), a few changes will
make this an ideal candidate for a remote backup. I'm still finetuning
the full script, but I hope you get the gist of it.
Using the --link-dest option, you get 14 'full backups' taking up
about 110% of the diskspace the original data uses (depending on the
type of data, of course) :
[EMAIL PROTECTED] $ cd /backup; du -shc *
13.2G 20051210
78.0M 20051211
76.3M 20051212
103M 20051213
102M 20051214
85.0M 20051215
81.7M 20051216
105M 20051217
81.3M 20051218
81.1M 20051219
84.1M 20051220
108M 20051221
116M 20051222
84.3M 20051223
14.3G total
Cheers,
Paul 'WEiRD' de Weerd
--
>++++++++[<++++++++++>-]<+++++++.>+++[<------>-]<.>+++[<+
+++++++++++>-]<.>++[<------------>-]<+.--------------.[-]
http://www.weirdnet.nl/
[demime 1.01d removed an attachment of type application/pgp-signature]