l i n u x - u s e r s - g r o u p - o f - d a v i s
L U G O D
 
Next Meeting:
January 6: Social gathering
Next Installfest:
TBD
Latest News:
Nov. 18: Club officer elections
Page last updated:
2006 May 02 19:42

The following is an archive of a post made to our 'vox-tech mailing list' by one of its subscribers.

Report this post as spam:

(Enter your email address)
[vox-tech] Incremental CD backups
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[vox-tech] Incremental CD backups



I just discovered the -root and -old-root options of mkisofs for 
creating incremental backups, and so I hacked together a scropt for 
creating said backups, which I'm attaching here for your scrutiny and 
use.

The subversion repository in /home/bloom_svn is an FSFS repository. I 
don't think you'll get a space savings if you're using a BDB 
repository, but I'm no expert.

One of my big goals in creating a script like this was to be able to run 
a few commands on the repository once it was backed up to CD to insure 
the integrity of the backup. Now I can accomplish that goal 
automatically as part of the backup script.

--Ken

----8<---------------------
#!/bin/bash

CDDEV=/dev/cdrom

#COLLECT DATA

[ -a /tmp/kenbackup ] && rm -rf /tmp/kenbackup

mkdir /tmp/kenbackup
ln -s /home/bloom_svn /tmp/kenbackup/subversion
ln -s /home/bloom/Maildir /tmp/kenbackup/Maildir

#MKISOFS

if [ -a /cdrom/backup-1 ]; then
   OLDVERSION=$(ls /cdrom --sort=time | head -n 1 | \
     sed -e 's@backup-@@')
   VERSION=$(( $OLDVERSION + 1 ))
   umount /cdrom
   MSINFO=$(cdrecord -msinfo dev=$CDDEV 2> /dev/null)
   mount /cdrom
   mkisofs -o /tmp/backup.iso -root backup-$VERSION \
      -old-root backup-$OLDVERSION \
      -f -J -l -r -C $MSINFO -M $CDDEV \
      /tmp/kenbackup
else
   VERSION=1
   mkisofs -o /tmp/backup.iso -root backup-$VERSION \
      -f -J -l -r /tmp/kenbackup
fi

#CDRECORD
umount /cdrom

cdrecord -v -multi -tao dev=$CDDEV -data /tmp/backup.iso

mount /cdrom

#VERIFY

echo Please verify that these results look correct:
echo ================================================
echo Running: svn ls file:///cdrom/backup-$VERSION/subversion
svn ls file:///cdrom/backup-$VERSION/subversion
echo ================================================

Attachment: pgp00000.pgp
Description: PGP signature

_______________________________________________
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


LinkedIn
LUGOD Group on LinkedIn
Sign up for LUGOD event announcements
Your email address:
facebook
LUGOD Group on Facebook
'Like' LUGOD on Facebook:

Hosting provided by:
Sunset Systems
Sunset Systems offers preconfigured Linux systems, remote system administration and custom software development.

LUGOD: Linux Users' Group of Davis
PO Box 2082, Davis, CA 95617
Contact Us

LUGOD is a 501(c)7 non-profit organization
based in Davis, California
and serving the Sacramento area.
"Linux" is a trademark of Linus Torvalds.

Sponsored in part by:
O'Reilly and Associates
For numerous book donations.