From 3b839841acaf65a29b2b810baae0488bb4b7ec1f Mon Sep 17 00:00:00 2001 From: c0dev0id Date: Wed, 16 Jul 2025 09:55:17 +0200 Subject: [PATCH] Update 2025-07-16 09:55 OpenBSD/amd64-t14 --- .bin/OLD/restore | 20 -------------------- .bin/OLD/tarsnap-delete | 21 --------------------- .bin/obsdmake | 16 ++++++++-------- .bin/tarsnap-backup | 15 ++++++++++++--- .bin/update-mystuff | 1 - .kshrc | 1 + 6 files changed, 21 insertions(+), 53 deletions(-) delete mode 100755 .bin/OLD/restore delete mode 100755 .bin/OLD/tarsnap-delete diff --git a/.bin/OLD/restore b/.bin/OLD/restore deleted file mode 100755 index acbe3f3..0000000 --- a/.bin/OLD/restore +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/sh -. $HOME/.bin/_config - -print "Tarsnap Restore:" - -if [ -z "$1" ]; then - doas tarsnap --list-archives | sort - printf "Usage: restore \n" - exit 2 -fi - -_backup="$(doas tarsnap --list-archives | grep "$1")" -if [ -z "$_backup" ]; then - print "No backup with key id $1 found." - exit 1 -fi - -mkdir "restore_$1" -doas tarsnap --humanize-numbers -xvf "$_backup" -C "restore_$1" -print "Data restored in $(readlink -f "restore_$1")" diff --git a/.bin/OLD/tarsnap-delete b/.bin/OLD/tarsnap-delete deleted file mode 100755 index e8eba31..0000000 --- a/.bin/OLD/tarsnap-delete +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/sh -. $HOME/.bin/_config - -print "Tarsnap Delete:" - -if [ -z "$1" ]; then - doas tarsnap --list-archives | sort - printf "Usage: delete \n" - exit 2 -fi - -_delete="$(doas tarsnap --list-archives | grep "$1")" -if [ -z "$_delete" ]; then - print "No backup with key id $1 found." - exit 1 -fi - -print "Deleting: $_delete" -doas tarsnap -df "$_delete" -print "done." - diff --git a/.bin/obsdmake b/.bin/obsdmake index c3d6516..45c668d 100755 --- a/.bin/obsdmake +++ b/.bin/obsdmake @@ -32,7 +32,7 @@ doas mkdir -p /usr/obj /usr/xobj doas chown build /usr/obj /usr/xobj mkkernel() { - echo "Step: kernel start ($(date)") >> $LOG + echo "Step: kernel start ($(date))" >> $LOG set -xe cd /sys/arch/$(machine)/compile/GENERIC.MP doas make clean @@ -42,11 +42,11 @@ mkkernel() { doas make install doas what /bsd doas ln -f /bsd.booted /bsd.backup - echo "Step: kernel done ($(date)") >> $LOG + echo "Step: kernel done ($(date))" >> $LOG } mkbase() { - echo "Step: base start ($(date)") >> $LOG + echo "Step: base start ($(date))" >> $LOG set -xe cd /usr/src doas make obj @@ -55,11 +55,11 @@ mkbase() { doas sysmerge cd /dev doas ./MAKEDEV all - echo "Step: base done ($(date)") >> $LOG + echo "Step: base done ($(date))" >> $LOG } mkxenocara() { - echo "Step: xenocara start ($(date)") >> $LOG + echo "Step: xenocara start ($(date))" >> $LOG set -xe doas chown -R sdk /usr/xenocara cd /usr/xenocara @@ -68,11 +68,11 @@ mkxenocara() { doas make obj doas make -j${JOBS} build doas make install - echo "Step: xenocara done ($(date)") >> $LOG + echo "Step: xenocara done ($(date))" >> $LOG } mkrelease() { - echo "Step: release start ($(date)") >> $LOG + echo "Step: release start ($(date))" >> $LOG set -xe doas mkdir -p /data/{OpenBSD,Release} doas chown -R build /data @@ -95,7 +95,7 @@ mkrelease() { cd /usr/src/distrib/$(machine)/iso doas make doas make install - echo "Step: release done ($(date)") >> $LOG + echo "Step: release done ($(date))" >> $LOG } kernelclean() { diff --git a/.bin/tarsnap-backup b/.bin/tarsnap-backup index 2cfd90e..74c2312 100755 --- a/.bin/tarsnap-backup +++ b/.bin/tarsnap-backup @@ -1,13 +1,22 @@ #!/bin/sh . $HOME/.bin/_config -[ -d "$1" ] || ( printf "Usage: backup \n" && exit 2; ) +_target=$(readlink -f "$1" 2> /dev/null) + +[ ! "$_target" ] \ + && printf "Usage: backup \n" \ + && exit 2; + +print "pass Internet/Tarsnap.key > /root/tarsnap.key ..." +pass Internet/Tarsnap.key | doas tee /root/tarsnap.key > /dev/null +doas chown root:sdk /root/tarsnap.key +doas chmod 640 /root/tarsnap.key +doas chmod 750 /root print "Tarsnap Backup:" -_target=$(readlink -f "$1") _key=$(pwgen -n1 8) _date=$(date "+%Y-%m-%d %H:%M") _host=$(uname -n) -doas tarsnap --humanize-numbers --checkpoint-bytes 52428800 --exclude "*/.git/*" -cvf "$_host: $_target $_date ($_key)" "$_target" +doas tarsnap --humanize-numbers --checkpoint-bytes 52428800 --exclude "*/.git/*" -cvf "$_host: $_target $_date ($_key)" "$_target" diff --git a/.bin/update-mystuff b/.bin/update-mystuff index 9e25c1e..7d55eb6 100755 --- a/.bin/update-mystuff +++ b/.bin/update-mystuff @@ -2,7 +2,6 @@ mystuff=" /usr/ports/mystuff/x11/st-sdk -/usr/ports/mystuff/www/luakit /usr/ports/mystuff/sysutils/libtree /usr/ports/sysutils/tarsnap " diff --git a/.kshrc b/.kshrc index 40647d9..887e7b2 100644 --- a/.kshrc +++ b/.kshrc @@ -239,6 +239,7 @@ mygot-clone() { # other alias portroach="portroach-cli -m codevoid" alias ugrep="\ugrep -nI --exclude=tags --exclude=.tags --exclude='cscope.*'" +alias tarsnap="doas \tarsnap" mystuff() { cd /usr/ports/mystuff