Koozali.org: home of the SME Server

Excluding from backups

Todd Pearsall

Excluding from backups
« on: July 08, 2002, 06:56:06 PM »
I have a 2nd drive mounted as /home/e-smith/files/ibays/music that I do not want included in the backup.

I've been messing around with a new backup template:
 /etc/e-smith/templates-custom/sbin/e-smith/backup/30flexbackup

{
    use esmith::db;

    local %services = (
        backup => $backup,
    );

    my $program = db_get_prop(\%services, 'backup', 'Program');

    $OUT .=
        (defined $program && $program eq 'flexbackup')
            ?  "/usr/bin/flexbackup -newtape \n/usr/bin/flexbackup -fs /boot -norewind \n/usr/bin/flexbackup -fs /"
            : "# flexbackup is not enabled as the backup Program";
}

Which looks OK to me after I expand it into /sbin/e-smith/backup:

/sbin/e-smith/signal-event mysql-delete-dumps > /dev/null 2>&1
/sbin/e-smith/signal-event mysql-dump-tables > /dev/null 2>&1

if /bin/mt -f "/dev/nht0" tell > /dev/null 2>&1
then
    # Some drives require zeroing the data before
    # they can be overwritten.

    /bin/mt -f "/dev/nht0" rewind > /dev/null 2>&1
    /bin/dd if=/dev/zero of="/dev/nht0" bs=32k count=1 > /dev/null 2>&1
    /bin/mt -f "/dev/nht0" rewind > /dev/null 2>&1
else
    echo "Backup aborted: No tape loaded"
    exit 1
fi

#### Start new entries
/usr/bin/flexbackup -newtape
/usr/bin/flexbackup -fs /boot -norewind
/usr/bin/flexbackup -fs /
#### End new entries

/sbin/e-smith/signal-event mysql-delete-dumps > /dev/null 2>&1
/bin/mt -f "/dev/nht0" rewind

But when the backup runs it looks like it still backups all the filesystems.  Am I going about this the right way or missing a better way to do it?  I was looking for an "exclude" option for Flexbackup, but it doesn't look like there is one.

Thanks,
Todd

Filippo Carletti

Re: Excluding from backups
« Reply #1 on: July 09, 2002, 02:59:27 AM »
Switch to tar format, supported by flexbackup and use the exclude directive in flexbackup.conf

Todd Pearsall

Re: Excluding from backups
« Reply #2 on: July 09, 2002, 09:14:32 PM »
Cool, trying it now!

Thanks.