Update 2023-02-22 08:31 OpenBSD/amd64
This commit is contained in:
21
.bin/tarsnap-delete
Executable file
21
.bin/tarsnap-delete
Executable file
@@ -0,0 +1,21 @@
|
||||
#!/bin/sh
|
||||
. $HOME/.bin/_config
|
||||
|
||||
print "Tarsnap Delete:"
|
||||
|
||||
if [ -z "$1" ]; then
|
||||
doas tarsnap --list-archives | sort
|
||||
printf "Usage: delete <key_id>\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."
|
||||
|
||||
Reference in New Issue
Block a user