24 lines
570 B
Bash
24 lines
570 B
Bash
|
REPO="aw:backup/backup.borg"
|
||
|
b-list() {
|
||
|
if [[ -z "$1" ]]; then
|
||
|
borg list "$REPO"
|
||
|
else
|
||
|
borg list "$REPO"::"$1"
|
||
|
fi
|
||
|
}
|
||
|
b-delete() {
|
||
|
if [[ ! -z "$1" ]]; then
|
||
|
borg delete "$REPO"::"$1"
|
||
|
fi
|
||
|
}
|
||
|
b-create() {
|
||
|
local BOOT=""
|
||
|
if (( $EUID != 0 )); then
|
||
|
echo -n "You aren't root, press enter to continue..." >&2
|
||
|
fi
|
||
|
if [[ ! "$(hostname)" = "SGen" ]]; then
|
||
|
BOOT="/boot"
|
||
|
fi
|
||
|
borg create -vpsx --compression lzma,7 --exclude-from /home/stonewareslord/syncthing/me/backup/$(hostname)/nobackup aw:backup/backup.borg::$(hostname)-$(uuidgen) / "$BOOT"
|
||
|
}
|