stop using unison, various updates
authorIan Kelling <ian@iankelling.org>
Mon, 5 Aug 2019 05:19:28 +0000 (01:19 -0400)
committerIan Kelling <ian@iankelling.org>
Mon, 5 Aug 2019 05:19:28 +0000 (01:19 -0400)
.gitconfig
brc
checkrestart-blacklist [new file with mode: 0644]
distro-pkgs
filesystem/usr/local/bin/mycheckrestart
myunison [deleted file]
unison-snapshot [deleted file]

index 89d01716ccd0afc9a8ce190af0379d57a6e67c7e..35556d60bf5583d4a22a495ded296432b8065d91 100644 (file)
@@ -26,7 +26,7 @@ helper = cache
 [diff]
 ignoreSubmodules = dirty
 tool = meld
-# gitinspector complained
+# gitinspector complained, but then i noticed git not detecting a rename with this.
 #renamelimit = 5000
 renames = copy
 
diff --git a/brc b/brc
index 55efac12039265d516bcac23b0ee91b756b2a289..80a4ae199b04c60a3ce688c312469c6df4b170d0 100644 (file)
--- a/brc
+++ b/brc
@@ -1489,8 +1489,6 @@ rlt() {
 rlu() { # [OPTS] HOST PATH
   # eg. rlu -opts frodo /testpath
   # relative paths will expanded with readlink -f.
-  # useful for selectively sending dirs which have been synced with unison,
-  # where the path is the same on both hosts.
   opts=("${@:1:$#-2}") #  1 to last -2
   path="${@:$#}" # last
   host="${@:$#-1:1}" # last -1
diff --git a/checkrestart-blacklist b/checkrestart-blacklist
new file mode 100644 (file)
index 0000000..c168beb
--- /dev/null
@@ -0,0 +1 @@
+/m/.*
\ No newline at end of file
index d72e4ecf4cd9ea033e657ee369d03587892b7ac9..5fdd13c2aea6697797e144dbb4bd5b04bc4c2ed5 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/bash -l
 
-err-catch
+source /a/bin/errhandle/err
 
 
 usage() {
index 64363b885201407f748f61a158c36941d894dca6..d82bf528f95700e4a93bdaa08abe77577ca40105 100755 (executable)
@@ -14,4 +14,4 @@ if [[ $HOSTNAME != "$MAIL_HOST" && $hn != li.b8.nz && ! $DISPLAY ]]; then
   exit 0
 fi
 
-$s checkrestart | sed '/^Found 0 processes using old versions of upgraded files$/d'
+$s /usr/sbin/checkrestart -b /a/bin/distro-setup/checkrestart-blacklist | sed '/^Found 0 processes using old versions of upgraded files$/d'
diff --git a/myunison b/myunison
deleted file mode 100755 (executable)
index f68ae34..0000000
--- a/myunison
+++ /dev/null
@@ -1,97 +0,0 @@
-#!/bin/bash -lx
-
-set -eE -o pipefail
-trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?" >&2' ERR
-
-# note, we could have done machine specific subvols,
-# but there were so few files, it just didn't seem
-# necessary to have an rw copy on those machines
-# which did not have the whole p subvol.
-
-gen_args=()
-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=true; shift ;;
-        -h|--help)
-            echo "$0: help is head of $BASH_SOURCE:"
-            head -n 30 "$BASH_SOURCE"
-            exit 0
-            ;;
-        --) shift; break ;;
-        -*) gen_args+=($1) ; shift ;;
-        *) host=$1; shift ;;
-    esac
-done
-if [[ ! $host ]]; then
-    host=$1
-fi
-
-if [[ $host == demohost ]]; then
-    do_snapshot=false
-fi
-
-# arch and debian don't play nice with unison.
-# "connection lost" on unison-gtk, with bignum errs in term,
-# and simply freezing on cli, all means compiled under
-# different ocaml versions.
-# I had the great realization that unison is a self contained
-# binary with no special runtime dependencies.
-# However, I got a gtk error running the ui version.
-# todo: I should test pushing my unison version instead
-# of pulling it.
-echo "$0: running: gen ${gen_args[@]}"
-/p/c/subdir_files/.unison/gen ${gen_args[@]}
-if [[ ! $host ]]; then
-    echo "$0: error: expected argument for hostname"
-    exit 1
-fi
-
-
-# todo: this doesn't deal with if the host is running arch too
-
-# debian uses this path, and has gtk version linked as /usr/bin/unison,
-# but I'd rather not push the gtk version
-push_path=/usr/bin/unison-latest-stable
-if [[ ! -e $push_path ]]; then
-    push_path=/usr/bin/unison
-fi
-# note, i'd prefer to use /usr/local/bin, but it's not in arch's default
-# path for root.
-rsync -L /usr/bin/unison-latest-stable root@$host:/usr/bin/unison
-
-if $do_snapshot; then
-    unison-snapshot
-    if ! ssh root@$host "! type unison-snapshot || unison-snapshot"; then
-        if [[ ! ${gen_args[@]} ]]; then
-            # gen_args are all about syncing with new systems where
-            # we could expect the remote snapshot to not be available yet.
-            echo "$0: error: failed remote unison-snapshot"
-            exit 1
-        fi
-    fi
-fi
-
-if $batch; then
-    # todo, figure out what the cli version is called in non-debian distros
-    f=unison-latest-stable
-else
-    f=unison-gtk
-    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
-        p=/p/c/machine_specific/$HOSTNAME/.unison/
-        s rsync -rlptgohi $p root@$host:$p
-    fi
-    p=/p/c/machine_specific/$host/.unison/
-    s rsync -rlptgohvi root@$host:$p $p
-fi
diff --git a/unison-snapshot b/unison-snapshot
deleted file mode 100755 (executable)
index 154eed0..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-#!/bin/bash -l
-set -eE -o pipefail
-trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?" >&2' ERR
-
-sv() { echo "$@"; "$@"; }
-
-date=unison-$(date "+%Y:%m:%d")
-for mountp in /mnt/root/q /mnt/iroot/i; do
-    [[ -e $mountp ]] || continue
-    date_path=${mountp%/*}/$date
-    todays=( $date_path-* )
-    IFS=$'\n' todays=($(sort -Vr <<<"${todays[*]}")); unset IFS
-    if [[ -e ${todays[0]} ]]; then
-        snapshot=$date_path-$(( ${todays[0]##*-} + 1 ))
-    else
-        snapshot=$date_path-1
-    fi
-    sv s btrfs subvolume snapshot -r $mountp $snapshot
-    existing=( ${mountp%/*}/unison-* )
-    IFS=$'\n' existing=($(sort -Vr <<<"${existing[*]}")); unset IFS
-    # keep 10 unison snapshots around
-    if (( ${#existing[@]} > 10 )); then
-        sv s btrfs subvolume delete ${existing[@]:10}
-    fi
-done