FAQ | This is a LIVE service | Changelog

Commit 491ba4b1 authored by Dr Adam Thorn's avatar Dr Adam Thorn
Browse files

Make default prepare scripts skip /lib/{modules,firmware} on xen VMs

Now that we use pygrub, these dirs are populated by quite a lot of files
that we don't want to back up but are dynamically built by the kernel/related
packages so do not make it into the the prepared "excludes" file
parent c206b71f
......@@ -3,6 +3,6 @@ Priority: optional
Section: otherosfs
Maintainer: Chemistry COs <support@ch.cam.ac.uk>
Architecture: all
Version: 0.9-ch92
Version: 0.9-ch93
Depends: zfs-dkms, postgresql-13 | postgresql-9.5 | postgresql-9.4 , liblockfile-simple-perl, libdbi-perl, libjson-perl, libzfs-perl-chem, libnet-openssh-perl, libdbd-pg-perl, mbuffer, rsync, nfs-kernel-server, pv, libwww-curl-perl
Description: a backup system using ZFS (repository 'backup-scheduler')
......@@ -42,6 +42,19 @@ if [ ! -f $CONFDIR/$SERVER/exclude ] ; then
$SCP -q root@$SERVER:/var/adm/backup/package-files $CONFDIR/$SERVER/exclude
fi
# If we can identify this as a xen VM, add some extra dirs to the exclude list
# because they include some files built by the kernel package but are not
# provided by it.
# systemd-detect-virt is present on all our Ubuntu VMs so is hopefully a
# reliable method to use
VIRT_TYPE=$(ssh root@$SERVER systemd-detect-virt 2>/dev/null)
if [ "$VIRT_TYPE" == "xen" ] ; then
cat<<EOF >> $CONFDIR/$SERVER/exclude
/lib/modules
/lib/firmware
EOF
fi
if $SSH root@$SERVER id postgres >/dev/null 2>&1 ; then
PGVER=$($SSH root@$SERVER pg_lsclusters| awk -F '[. ]+' '/online/ { print $1 }')
if [[ -n "$PGVER" ]]; then
......
......@@ -48,6 +48,19 @@ if [ ! -f $CONFDIR/$SERVER/exclude ] ; then
$SCP -q root@$SERVER:/var/adm/backup/package-files $CONFDIR/$SERVER/exclude
fi
# If we can identify this as a xen VM, add some extra dirs to the exclude list
# because they include some files built by the kernel package but are not
# provided by it.
# systemd-detect-virt is present on all our Ubuntu VMs so is hopefully a
# reliable method to use
VIRT_TYPE=$(ssh root@$SERVER systemd-detect-virt 2>/dev/null)
if [ "$VIRT_TYPE" == "xen" ] ; then
cat<<EOF >> $CONFDIR/$SERVER/exclude
/lib/modules
/lib/firmware
EOF
fi
$SSH root@$SERVER "
# Ensure that things are not readable where they ought not to be
umask 077
......
......@@ -48,6 +48,19 @@ if [ ! -f $CONFDIR/$SERVER/exclude ] ; then
$SCP -q root@$SERVER:/var/adm/backup/package-files $CONFDIR/$SERVER/exclude
fi
# If we can identify this as a xen VM, add some extra dirs to the exclude list
# because they include some files built by the kernel package but are not
# provided by it.
# systemd-detect-virt is present on all our Ubuntu VMs so is hopefully a
# reliable method to use
VIRT_TYPE=$(ssh root@$SERVER systemd-detect-virt 2>/dev/null)
if [ "$VIRT_TYPE" == "xen" ] ; then
cat<<EOF >> $CONFDIR/$SERVER/exclude
/lib/modules
/lib/firmware
EOF
fi
$SSH root@$SERVER "
# Ensure that things are not readable where they ought not to be
umask 077
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment