6.3.2. How Does It Work?
The
ISO 9660 is unfortunately limited to eight-character filenames with a three-character extension. The Rock Ridge (RR) extension adds support for long filenames, user and group ownership, and permission mode under Linux; Joliet extensions add similar support for the Windows operating systems. Using the -JR option to
When backing up to tape,
The z option to
6.3.3. What About...
6.3.3.1. ...using LVM snapshots in a backup script?
You can simply place the appropriate
Here is a slightly fancier version of the DVD backup script, which accepts a list of
#!/bin/bash
#
# backup-dvd :: backup selected directories to a compressed DVD
#
# List of the vg/lv to be backed up
LVLIST='main/home main/var'
# Amount of space to use for snapshots
SNAPSIZE='1G'
# Create timestamp file
(
rm -f /system-*
touch /system-$(hostname)
# Make directory for compressed backup tree
rm -rf /tmp/zftree
mkdir /tmp/zftree
RESULT=0
for VGLV in $LVLIST
do
echo '========= Processing $VGLV...'
# Get information about the vg/lv
VG=$(echo $VGLV|cut -f1 -d/)
LV=$(echo $VGLV|cut -f2 -d/)
SNAPNAME='${LV}-snap'
OLDMOUNT=
$(grep '^/dev/${VGLV}' /etc/fstab|tr ' ' ' '|tr -s ' '|cut -f2 -d' ')
NEWMOUNT='/mnt/snap${OLDMOUNT}'
# Create a snapshot
lvcreate -s $VGLV --name $SNAPNAME --size $SNAPSIZE
RESULT=$(( $? + $RESULT ))
# Mount the snapshot
mkdir -p $NEWMOUNT
mount -o ro /dev/${VG}/${SNAPNAME} ${NEWMOUNT}
RESULT=$(( $? + $RESULT ))
# Place it in the zftree
mkdir -p /tmp/zftree$(dirname $OLDMOUNT)
mkzftree ${NEWMOUNT} /tmp/zftree${OLDMOUNT}
RESULT=$(( $? + $RESULT ))
# Unmount the snapshot
umount $NEWMOUNT
# Release the snapshot
lvremove -f ${VG}/${SNAPNAME}
done
if [ '$RESULT' -eq 0 ]
then
# Burn the DVD