summaryrefslogtreecommitdiffstats
path: root/.bin/bck-create
blob: 9714af6dfcf13f74287dd8103dc4010c6bb912fc (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/bin/sh

set -xe

directories="${HOME}/docs
	${HOME}/git.rgoncalves.se
	${HOME}/.local/share/gopass
	${HOME}/.local/share/mail
	${HOME}/.local/share/yadm
	${HOME}/.local/share/zk"

pgp_id=$(gpg --list-secret-keys | grep -A 1 sec | tail -n 1 | tr -d " ")
output_name="$(date -u +"%Y-%m-%dT%H_%M_%S%Z").tar.pgp"

if [ -d "${1}" ]; then
	output_name="${1}/${output_name}"
elif [ -f "${1}" ] || [ "${1}" ]; then
	output_name="${1}"
fi

tar cvf - ${directories} | lz4 | gpg -e -z 0 -r "${pgp_id}" > "${output_name}"
remember that computers suck.