X-Git-Url: https://iankelling.org/git/?a=blobdiff_plain;f=myunison;h=f68ae34af1337111201affd1d8ff4279eec63ada;hb=7cc6197f74e97cb522894046718712cd03d3d385;hp=2e0f14928f37ab4f294ae7f38a5d092150ef1ff8;hpb=c12fecb2eb85890400d451732a2acecce5b69bc4;p=distro-setup diff --git a/myunison b/myunison index 2e0f149..f68ae34 100755 --- a/myunison +++ b/myunison @@ -1,4 +1,4 @@ -#!/bin/bash -l +#!/bin/bash -lx set -eE -o pipefail trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?" >&2' ERR @@ -9,13 +9,13 @@ trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?" >&2' ERR # which did not have the whole p subvol. gen_args=() -do_snapshot=true +do_snapshot=false batch=false while [[ $1 ]]; do case $1 in -ob) gen_args+=(--ours -b); batch=true; shift ;; -b) gen_args+=(-b); batch=true; shift ;; - -n) do_snapshot=false; shift ;; + -n) do_snapshot=true; shift ;; -h|--help) echo "$0: help is head of $BASH_SOURCE:" head -n 30 "$BASH_SOURCE" @@ -61,7 +61,7 @@ if [[ ! -e $push_path ]]; then fi # note, i'd prefer to use /usr/local/bin, but it's not in arch's default # path for root. -scp /usr/bin/unison-latest-stable root@$host:/usr/bin/unison +rsync -L /usr/bin/unison-latest-stable root@$host:/usr/bin/unison if $do_snapshot; then unison-snapshot @@ -83,6 +83,9 @@ else type -t $f &>/dev/null || f=unison-gtk2 # for arch fi + + s ln -sTf ~/.unison /root/.unison + if s $f "$host"; then if [[ $host == frodo ]]; then # only send data to the machine i do full backups to