borgmatic-base/scripts/os_fedora

40 lines
611 B
Text
Raw Permalink Normal View History

2021-09-04 09:17:00 -04:00
#!/bin/bash
restoreDir="/etc/restore"
hook_check() {
:
2021-09-04 09:17:00 -04:00
}
hook_pre() {
mkdir -p "$restoreDir" || exit 1
pushd "$restoreDir" || exit 2
rpm -qa | sort > Package.versions.list
rpm -qa --queryformat '%{NAME}.%{ARCH}\n' | sort > Package.list
cat > restore.sh <<EOF
#!/bin/bash
if [[ ! -f "Package.list" ]]; then
echo "This needs to be run inside the restore directory."
exit 1
fi
dnf install \$(cat Package.list)
EOF
popd || exit 2
}
hook_post() {
:
2021-09-04 09:17:00 -04:00
}
case "$1" in
before_check) hook_check;;
before_backup) hook_pre;;
after_backup) hook_post;;
esac