Update 2025-07-16 09:55 OpenBSD/amd64-t14

This commit is contained in:
c0dev0id
2025-07-16 09:55:17 +02:00
parent 9f365fe933
commit 3b839841ac
6 changed files with 21 additions and 53 deletions

View File

@@ -1,13 +1,22 @@
#!/bin/sh
. $HOME/.bin/_config
[ -d "$1" ] || ( printf "Usage: backup <target>\n" && exit 2; )
_target=$(readlink -f "$1" 2> /dev/null)
[ ! "$_target" ] \
&& printf "Usage: backup <target>\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"