example /etc/backup.d/action.sh:

dpkg --get-selections > /var/backups/dpkg-selections.txt