FAQ | This is a LIVE service | Changelog

Commit c714a331 authored by Dr Adam Thorn's avatar Dr Adam Thorn
Browse files

Pipe list of package-files through realpath, to resolve any symlinks

As of focal a bunch of top-level dirs are symlinks (eg /lib -> /usr/lib) but
the deb packages still deploy files to the symlink rather than the real dir.
Thus if we just take the contents of all the *.list files we end up not
excluding lots of files that are in fact provided by debs
parent 1f0640b7
......@@ -3,7 +3,6 @@ Priority: optional
Section: otherosfs
Maintainer: Chemistry COs <support@ch.cam.ac.uk>
Architecture: all
Version: 0.9-ch72
Version: 0.9-ch73
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')
Ported (well, mostly) from FreeBSD to a Sane OS.
......@@ -30,7 +30,7 @@ if $SSH root@$SERVER [ /var/lib/dpkg/status -nt /var/adm/backup/package-files ]
dpkg --get-selections | awk ' { print \$1 ; } ' >/var/adm/backup/packages
cat /var/lib/dpkg/info/*.list | while read F ; do [ -f \"\$F\" ] && echo \"\$F\" ; done | sort > \$FILELIST
awk '/Description:/ { flag = 0 } ; flag == 1 { print \$1 ; } ; /Conffiles:/ { flag = 1 } ; ' </var/lib/dpkg/status | sort >\$CONFLIST
diff -u \$FILELIST \$CONFLIST | grep ^-/ | sed s/^-// >/var/adm/backup/package-files
diff -u \$FILELIST \$CONFLIST | grep ^-/ | sed s/^-// | xargs -n1 realpath >/var/adm/backup/package-files
rm \$FILELIST \$CONFLIST
"
mkdir -p $CONFDIR/$SERVER
......
......@@ -36,7 +36,7 @@ if $SSH root@$SERVER [ /var/lib/dpkg/status -nt /var/adm/backup/package-files ]
dpkg --get-selections | awk ' { print \$1 ; } ' >/var/adm/backup/packages
cat /var/lib/dpkg/info/*.list | while read F ; do [ -f \"\$F\" ] && echo \"\$F\" ; done | sort > \$FILELIST
awk '/Description:/ { flag = 0 } ; flag == 1 { print \$1 ; } ; /Conffiles:/ { flag = 1 } ; ' </var/lib/dpkg/status | sort >\$CONFLIST
diff -u \$FILELIST \$CONFLIST | grep ^-/ | sed s/^-// >/var/adm/backup/package-files
diff -u \$FILELIST \$CONFLIST | grep ^-/ | sed s/^-// | xargs -n1 realpath >/var/adm/backup/package-files
rm \$FILELIST \$CONFLIST
"
mkdir -p $CONFDIR/$SERVER
......
......@@ -36,7 +36,7 @@ if $SSH root@$SERVER [ /var/lib/dpkg/status -nt /var/adm/backup/package-files ]
dpkg --get-selections | awk ' { print \$1 ; } ' >/var/adm/backup/packages
cat /var/lib/dpkg/info/*.list | while read F ; do [ -f \"\$F\" ] && echo \"\$F\" ; done | sort > \$FILELIST
awk '/Description:/ { flag = 0 } ; flag == 1 { print \$1 ; } ; /Conffiles:/ { flag = 1 } ; ' </var/lib/dpkg/status | sort >\$CONFLIST
diff -u \$FILELIST \$CONFLIST | grep ^-/ | sed s/^-// >/var/adm/backup/package-files
diff -u \$FILELIST \$CONFLIST | grep ^-/ | sed s/^-// | xargs -n1 realpath >/var/adm/backup/package-files
rm \$FILELIST \$CONFLIST
"
mkdir -p $CONFDIR/$SERVER
......
......@@ -26,7 +26,7 @@ if $SSH root@$SERVER [ /var/lib/dpkg/status -nt /var/adm/backup/package-files ]
dpkg --get-selections | awk ' { print \$1 ; } ' >/var/adm/backup/packages
cat /var/lib/dpkg/info/*.list | while read F ; do [ -f \"\$F\" ] && echo \"\$F\" ; done | sort > \$FILELIST
awk '/Description:/ { flag = 0 } ; flag == 1 { print \$1 ; } ; /Conffiles:/ { flag = 1 } ; ' </var/lib/dpkg/status | sort >\$CONFLIST
diff -u \$FILELIST \$CONFLIST | grep ^-/ | sed s/^-// >/var/adm/backup/package-files
diff -u \$FILELIST \$CONFLIST | grep ^-/ | sed s/^-// | xargs -n1 realpath >/var/adm/backup/package-files
rm \$FILELIST \$CONFLIST
"
mkdir -p /etc/chem-zfs-backup-server/zfs-rsync.d/$SERVER
......
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