dotfiles/.bin/tarsnap-backup
2024-02-14 07:55:58 +01:00

14 lines
353 B
Bash
Executable File

#!/bin/sh
. $HOME/.bin/_config
[ -d "$1" ] || ( printf "Usage: backup <target>\n" && exit 2; )
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"