James Melin wrote:
This is more of a 'how do YOU do it ancillary question'...

Obviously to get a decent system backup from within Linux you should be in 
single user mode, or even quiesced completely (if you're doing CDL volume
backups, for instance).

What are people doing to get a given image into single-user mode (or shut down) 
and then restarted in an automated way?  Just curious because as
always, there's 10 ways to do something that achieve the same goal, and 
comparing the various methods/philosophies might be of use to some.


I regularly backup a Linux server running on Intel.

I've decided some files (eg logs) aren't that important: if they were,
I'd log to another machine.

I used to rsync from one box to another (over ADSL) but that was proved
way too slow, whatever the rsync folk said.

Now, I create an ext2 filesystem image:
dd if=/dev/zero of=${Image} count=0 bs=1024 \
        seek=$((7*1024*1024))
mke2fs -Fq ${Image}

I mount it, populate it with tar:
find /var -xdev -type p -o -type s >${excludes}
tar clC / --exclude=backup.img --exclude=/tmp --exclude=/mnt\/*
--exclude=/var/lock --exclude=swapfil\* \
        --exclude=/var/autofs --exclude=lost+found --exclude=/var/tmp
--exclude=/var/local --exclude=squid-cache \
        --exclude=/var/spool/cyrus/mail-backup \
        --exclude-from=${excludes} \
        / /boot /home  /var \
        | buffer -m $((2*1024*1024)) -p 75\
        | tar xpC /mnt/backup || { df -h ; exit ; }

I want the files compressed and on an ISO filesystem, so:
rm ${Image}
mkzftree --one-filesystem /mnt/backup/ /var/tmp/backup
umount /mnt/backup/
mkisofs -R -z -quiet -nobak \
  -o /var/tmp/backup-${HOSTNAME}.iso /var/tmp/backup

I then have an image which I can burn to DVD (if it still fits!), or
"mount -o loop" and the Linux kernel decompresses the files.

I use tar because it has adequate file filtering capability; mkzftree
has none:-(( (and that's why I unlink the backup where I do).

I'd exclude databases & c here and make separate arrangements for them.


Once I have the image, I rsync it to images in two other locations, one
local and one off-site. Using rsync to replicate the directory structure
 took hours, days if it got a bit behind (and took an enormous amount
of virtual storage, fortunately without inducing swapping), whereas the
image takes about an hour to sync.



--

Cheers
John

-- spambait
[EMAIL PROTECTED]  [EMAIL PROTECTED]
Tourist pics http://portgeographe.environmentaldisasters.cds.merseine.nu/

do not reply off-list

----------------------------------------------------------------------
For LINUX-390 subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: INFO LINUX-390 or visit
http://www.marist.edu/htbin/wlvindex?LINUX-390

Reply via email to