4 trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?" >&2' ERR
10 -n) do_snapshot
=false
; shift ;;
12 -*) gen_args
+=($1) ; shift ;;
18 # arch and debian don't play nice with unison.
19 # "connection lost" on unison-gtk, with bignum errs in term,
20 # and simply freezing on cli, all means compiled under
21 # different ocaml versions.
22 # I had the great realization that unison is a self contained
23 # binary with no special runtime dependencies.
24 # However, I got a gtk error running the ui version.
25 # todo: I should test pushing my unison version instead
27 /p
/c
/subdir_files
/.unison
/gen
${gen_args[@]}
28 if [[ ! $host ]]; then
29 echo "$0: error: expected argument for hostname"
34 # todo: this doesn't deal with if the host is running arch too
36 # note, without bash, it prints some crap about tty
37 # on an uncustomized jessie install.
38 scp
/usr
/bin
/unison root@
$host:/usr
/local
/bin
40 echo "$0: egen args ${gen_args[@]}"
43 if ! ssh root@
$host unison-snapshot
; then
44 if [[ ! ${gen_args[@]} ]]; then
45 # gen_args are all about syncing with new systems where
46 # we could expect the remote snapshot to not be available yet.
47 echo "$0: error: failed remote unison-snapshot"
54 type -t $f &>/dev
/null || f
=unison-gtk2
# for arch
56 if [[ $host == frodo
]]; then
57 # only send data to the machine i do full backups to
58 p
=/p
/c
/machine_specific
/$HOSTNAME/.unison
/
59 s rsync
-rlptgohi $p root@
$host:$p
61 p
=/p
/c
/machine_specific
/$host/.unison
/
62 s rsync
-rlptgohvi root@
$host:$p $p