_hostrun () {
h=$1 cmd=$2
- ## Like hostrun, but without the complicated logging, but targetted at a
+ ## Like hostrun, but without the complicated logging, and targetted at a
## specific host.
if localp $h; then sh -c "$cmd"
$verbose " commit"
## Expire old backups.
+ case "${expire_policy+t},${default_policy+t}" in
+ ,t) expire_policy=$default_policy ;;
+ esac
case "${expire_policy+t},$dryrun" in
t,nil) run "expiry for $host:$fs" expire_backups ;;
t,t) expire_backups ;;
esac
+ clear_policy=t
## Report success.
case $dryrun in
###--------------------------------------------------------------------------
### Configuration functions.
-host () { host=$1; like=; $verbose "host $host"; }
+host () {
+ host=$1
+ like=
+ case "${expire_policy+t},${default_policy+t}" in
+ t,) default_policy=$expire_policy ;;
+ esac
+ unset expire_policy
+ $verbose "host $host"
+}
+
snaptype () { snap=$1; shift; snapargs="$*"; retry=0; }
rsyncargs () { rsyncargs="$*"; }
like () { like="$*"; }
retry () { retry="$*"; }
retain () {
+ case $clear_policy in t) unset expire_policy; clear_policy=nil ;; esac
expire_policy="${expire_policy+$expire_policy
}$*"
}