Option to create standard backups on ZFS setups

This commit is contained in:
Jose
2020-10-15 16:20:25 -04:00
parent 917b4d8d0b
commit 67a9c65912

View File

@@ -32,7 +32,7 @@
. /usr/local/etc/bastille/bastille.conf
usage() {
error_exit "Usage: bastille export TARGET"
error_exit "Usage: bastille export TARGET [option]"
}
# Handle special-case commands first
@@ -42,10 +42,25 @@ help|-h|--help)
;;
esac
if [ $# -ne 0 ]; then
if [ $# -gt 1 ] || [ $# -lt 0 ]; then
usage
fi
OPTION="${1}"
# Handle some options
if [ -n "${OPTION}" ]; then
if [ "${OPTION}" = "-t" -o "${OPTION}" = "--txz" ]; then
if [ "${bastille_zfs_enable}" = "YES" ]; then
# Temporarily disable ZFS so we can create a standard backup archive
bastille_zfs_enable="NO"
fi
else
error_notify "Invalid option!"
usage
fi
fi
jail_export()
{
# Attempt to export the container