summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorerdgeist <erdgeist@erdgeist.org>2013-04-24 03:15:58 +0000
committererdgeist <erdgeist@erdgeist.org>2013-04-24 03:15:58 +0000
commit0ddb055c5a9fd528b0c01bd1a034dbcb7478b46a (patch)
treea0e72d3a1e2168412aab6265911c6b385ff31407
parent9dcfe49b30e3bea80273d8e1bc9b852a3e48b431 (diff)
Put an example retention policy in sample config
-rwxr-xr-xezjail-admin4
-rwxr-xr-xezjail.conf.sample7
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 () {
181 echo export jail_${ezjail_safename}_parentzfs=\"${ezjail_parentzfs}\" 181 echo export jail_${ezjail_safename}_parentzfs=\"${ezjail_parentzfs}\"
182 echo export jail_${ezjail_safename}_parameters=\"${ezjail_parameters}\" 182 echo export jail_${ezjail_safename}_parameters=\"${ezjail_parameters}\"
183 echo export jail_${ezjail_safename}_post_start_script=\"${ezjail_post_start_script}\" 183 echo export jail_${ezjail_safename}_post_start_script=\"${ezjail_post_start_script}\"
184 echo export jail_${ezjail_safename}_retention_policy=\"${ezjail_retention_policy}\"
184 185
185 ) > "${ezjail_destconf}" 186 ) > "${ezjail_destconf}"
186 187
@@ -231,6 +232,7 @@ fetchjailinfo () {
231 eval ezjail_parentzfs=\"\$jail_${ezjail_safename}_parentzfs\" 232 eval ezjail_parentzfs=\"\$jail_${ezjail_safename}_parentzfs\"
232 eval ezjail_parameters=\"\$jail_${ezjail_safename}_parameters\" 233 eval ezjail_parameters=\"\$jail_${ezjail_safename}_parameters\"
233 eval ezjail_post_start_script=\"\$jail_${ezjail_safename}_post_start_script\" 234 eval ezjail_post_start_script=\"\$jail_${ezjail_safename}_post_start_script\"
235 eval ezjail_retention_policy=\"\$jail_${ezjail_safename}_retention_policy\"
234 236
235 # Pre ezjail-3.3-jails do not have this set 237 # Pre ezjail-3.3-jails do not have this set
236 : ${ezjail_parentzfs:=${ezjail_jailzfs}} 238 : ${ezjail_parentzfs:=${ezjail_jailzfs}}
@@ -1242,7 +1244,7 @@ snapshot)
1242 [ "${ezjail_imagetype}" = "zfs" ] && ezjail_zfs_datasets="${ezjail_parentzfs}/${ezjail_hostname} ${ezjail_zfs_datasets}" 1244 [ "${ezjail_imagetype}" = "zfs" ] && ezjail_zfs_datasets="${ezjail_parentzfs}/${ezjail_hostname} ${ezjail_zfs_datasets}"
1243 1245
1244 # Use global retention policy, if none set 1246 # Use global retention policy, if none set
1245 : ${ezjail_retention_policy=${ezjail_default_retention_policy}} 1247 : ${ezjail_retention_policy:=${ezjail_default_retention_policy}}
1246 1248
1247 for ezjail_zfs in ${ezjail_zfs_datasets}; do 1249 for ezjail_zfs in ${ezjail_zfs_datasets}; do
1248 check_for_zfs_exist ${ezjail_zfs} || continue 1250 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 @@
55# ezjail_use_zfs_for_jails="YES" 55# ezjail_use_zfs_for_jails="YES"
56 56
57# The name of the ZFS ezjail should create jails on, it will be mounted at the ezjail_jaildir 57# The name of the ZFS ezjail should create jails on, it will be mounted at the ezjail_jaildir
58
59# ezjail_jailzfs="tank/ezjail" 58# ezjail_jailzfs="tank/ezjail"
59
60# ADVANCED, be very careful! 60# ADVANCED, be very careful!
61# ezjail_zfs_properties="-o compression=lzjb -o atime=off" 61# ezjail_zfs_properties="-o compression=lzjb -o atime=off"
62# ezjail_zfs_jail_properties="-o dedup=on" 62# ezjail_zfs_jail_properties="-o dedup=on"
63
64# For auto snapshots this is the default policy to keep old snapshots. In each window there
65# will be guaranteed to be one or two snapshots only
66# If this variable is not set, no snapshots will be removed by ezjail-admin snapshot
67# ezjail_default_retention_policy="4x15m 3x1h 2x2h 4h 12h 6x1d 7x1w 11x4w 1000x1y"