# note p/m is owned 1000:1000 and chmod 700
-targets=()
mountpoints=()
rsync_mountpoint=/q
eval set -- "$temp"
while true; do
case $1 in
+ # only creates the config file, does not run btrbk
-c) conf_only=true; shift ;;
-l) rate_limit=$2; shift 2 ;;
-m) IFS=, mountpoints=($2); unset IFS; shift 2 ;;
-p) progress_arg="--progress"; shift ;;
# btrbk arg: Resume only. Skips snapshot creation.
-r) resume_arg=-r; shift ;;
+ # empty is valid for just doing local snapshot. we have default hosts
+ # we will populate
-t) IFS=, targets=($2); unset IFS; shift 2 ;;
-v) verbose=true; verbose_arg=-v; shift ;;
-h|--help) usage ;;
echo -e "$0: options: conf_only=$conf_only\ndry_run=$dry_run\nresume_arg=$resume_arg\nrate_limit=$rate_limit\nverbose=$verbose"
# set default targets
-if ! (( ${#targets[@]} )); then
+if [[ ! -v targets ]]; then
case $HOSTNAME in
x2)
if [[ $HOSTNAME == "$MAIL_HOST" ]]; then
fi
fi
;;
+ frodo)
+ targets=()
+ ;;
*)
echo "$0: error: no default targets for this host, use -t"
exit 1
fi
done
else # set default mountpoints
- prospective_mps=(/a /q)
- if [[ $HOSTNAME == "$MAIL_HOST" ]]; then
- prospective_mps+=(/o)
- fi
- for tg in ${targets[@]}; do
- if [[ $tg == frodo && $HOSTNAME == treetowl ]]; then
- prospective_mps+=(/i)
+ if [[ $HOSTNAME == frodo ]]; then
+ prospective_mps=(/i)
+ else
+ prospective_mps=(/a /q)
+ if [[ $HOSTNAME == "$MAIL_HOST" ]]; then
+ prospective_mps+=(/o)
fi
- done
+ fi
for mp in ${prospective_mps[@]}; do # default mountpoints to sync
if [[ -e /nocow/btrfs-stale/$mp ]]; then
echo "$0: warning: $mp stale, not adding to default mountpoints"