sync/zsh/borg.zsh

27 lines
470 B
Bash
Raw Normal View History

2016-08-29 11:54:43 -04:00
REPO="aw:backup/backup.borg"
b-list() {
if [[ -z "$1" ]]; then
column -t <(borg list "$REPO")
2016-08-29 11:54:43 -04:00
else
borg list "$REPO"::"$1"
fi
}
b-delete() {
if [[ ! -z "$1" ]]; then
borg delete "$REPO"::"$1"
fi
}
b-create() {
2016-09-09 12:01:04 -04:00
local SUDO=""
if command -v sudo > /dev/null; then
SUDO="$(command -v sudo)"
2016-08-29 11:54:43 -04:00
fi
2016-09-09 12:01:04 -04:00
$SUDO /home/stonewareslord/syncthing/me/backup/$(hostname)/backup
2016-08-29 11:54:43 -04:00
}
b-rename() {
borg rename -v "$REPO"::"$1" "$2"
}
b-cmd() {
echo "$REPO"
}