From 0ddb055c5a9fd528b0c01bd1a034dbcb7478b46a Mon Sep 17 00:00:00 2001 From: erdgeist Date: Wed, 24 Apr 2013 03:15:58 +0000 Subject: Put an example retention policy in sample config --- ezjail-admin | 4 +++- ezjail.conf.sample | 7 ++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/ezjail-admin b/ezjail-admin index 8e24af0..099af05 100755 --- a/ezjail-admin +++ b/ezjail-admin @@ -181,6 +181,7 @@ writejailinfo () { echo export jail_${ezjail_safename}_parentzfs=\"${ezjail_parentzfs}\" echo export jail_${ezjail_safename}_parameters=\"${ezjail_parameters}\" echo export jail_${ezjail_safename}_post_start_script=\"${ezjail_post_start_script}\" + echo export jail_${ezjail_safename}_retention_policy=\"${ezjail_retention_policy}\" ) > "${ezjail_destconf}" @@ -231,6 +232,7 @@ fetchjailinfo () { eval ezjail_parentzfs=\"\$jail_${ezjail_safename}_parentzfs\" eval ezjail_parameters=\"\$jail_${ezjail_safename}_parameters\" eval ezjail_post_start_script=\"\$jail_${ezjail_safename}_post_start_script\" + eval ezjail_retention_policy=\"\$jail_${ezjail_safename}_retention_policy\" # Pre ezjail-3.3-jails do not have this set : ${ezjail_parentzfs:=${ezjail_jailzfs}} @@ -1242,7 +1244,7 @@ snapshot) [ "${ezjail_imagetype}" = "zfs" ] && ezjail_zfs_datasets="${ezjail_parentzfs}/${ezjail_hostname} ${ezjail_zfs_datasets}" # Use global retention policy, if none set - : ${ezjail_retention_policy=${ezjail_default_retention_policy}} + : ${ezjail_retention_policy:=${ezjail_default_retention_policy}} for ezjail_zfs in ${ezjail_zfs_datasets}; do check_for_zfs_exist ${ezjail_zfs} || continue diff --git a/ezjail.conf.sample b/ezjail.conf.sample index 84b4f8b..6ddd066 100755 --- a/ezjail.conf.sample +++ b/ezjail.conf.sample @@ -55,8 +55,13 @@ # ezjail_use_zfs_for_jails="YES" # The name of the ZFS ezjail should create jails on, it will be mounted at the ezjail_jaildir - # ezjail_jailzfs="tank/ezjail" + # ADVANCED, be very careful! # ezjail_zfs_properties="-o compression=lzjb -o atime=off" # ezjail_zfs_jail_properties="-o dedup=on" + +# For auto snapshots this is the default policy to keep old snapshots. In each window there +# will be guaranteed to be one or two snapshots only +# If this variable is not set, no snapshots will be removed by ezjail-admin snapshot +# ezjail_default_retention_policy="4x15m 3x1h 2x2h 4h 12h 6x1d 7x1w 11x4w 1000x1y" -- cgit v1.2.3