1 2 3 4 5 6 7 8 9 10 11
[Trigger] Operation = Upgrade Type = Package Target = boot/vmlinuz* [Action] Description = Saving Linux kernel modules... When = PreTransaction Depends = rsync Exec = /bin/sh -c 'KVER="${KVER:-$(uname -r)}"; if test -e "/lib/modules/${KVER}"; then rsync -AHXal --delete-after "/lib/modules/${KVER}" /lib/modules/backup/; fi'