Update borg backup scripts

This commit is contained in:
dctrud 2023-02-05 11:47:09 +00:00
parent 0a83ba9952
commit 34f2d3591d
4 changed files with 27 additions and 8 deletions

View File

@ -1,7 +1,8 @@
#!/usr/bin/env bash
HOST="inspiron"
DEST="de1103@de1103.rsync.net:borg_${HOST}"
SOURCES=("/home" "/data/Shared/Shared_Documents" "/data/Shared/Shared_Software")
DEST="dctrud@piran:/usb/Backup/borg_${HOST}"
SOURCES=("/home" "/mnt/c/Users" "/mnt/d")
EXCLUDE="/mnt/d/archive"
if [ "$(hostname -s)" != "${HOST}" ]; then
echo "Must be run from ${HOST}"
@ -9,7 +10,7 @@ if [ "$(hostname -s)" != "${HOST}" ]; then
fi
echo "Backup to ${DEST}"
sudo borg create --remote-path=borg1 -s --progress "${DEST}::$(date '+%Y%m%d-%H%M')" "${SOURCES[@]}"
sudo borg create -s --progress -e "${EXCLUDE}" "${DEST}::$(date '+%Y%m%d-%H%M')" "${SOURCES[@]}"
echo
echo DONE

View File

@ -1,7 +1,8 @@
#!/usr/bin/env bash
HOST="LEGION"
DEST="dctrud@piran:/usb/borg/borg_${HOST}"
SOURCES=("/home" "/mnt/d/Ben" "/mnt/d/Dave" "/mnt/d/Dona" "/mnt/d/Shared" "/mnt/d/Thomas")
DEST="dctrud@piran:/usb/Backup/borg_${HOST}"
SOURCES=("/home" "/mnt/c/Users" "/mnt/d")
EXCLUDE="/mnt/d/archive"
if [ "$(hostname -s)" != "${HOST}" ]; then
echo "Must be run from ${HOST}"
@ -9,7 +10,7 @@ if [ "$(hostname -s)" != "${HOST}" ]; then
fi
echo "Backup to ${DEST}"
sudo borg create -s --progress "${DEST}::$(date '+%Y%m%d-%H%M')" "${SOURCES[@]}"
sudo borg create -s --progress -e "${EXCLUDE}" "${DEST}::$(date '+%Y%m%d-%H%M')" "${SOURCES[@]}"
echo
echo DONE

16
bin/backup_matey.sh Executable file
View File

@ -0,0 +1,16 @@
#!/usr/bin/env bash
HOST="matey"
DEST="dctrud@piran:/usb/Backup/borg_${HOST}"
SOURCES=("/home" "/mnt/c/Users")
if [ "$(hostname -s)" != "${HOST}" ]; then
echo "Must be run from ${HOST}"
exit 255
fi
echo "Backup to ${DEST}"
sudo borg create -s --progress "${DEST}::$(date '+%Y%m%d-%H%M')" "${SOURCES[@]}"
echo
echo DONE
echo

View File

@ -1,7 +1,8 @@
#!/usr/bin/env bash
HOST="mini"
DEST="dctrud@piran:/usb/borg/borg_${HOST}"
SOURCES=("/home" "/etc" "/var" /"data")
SOURCES=("/home" "/etc" "/var" "/data")
EXCLUDE="/data/archive"
if [ "$(hostname -s)" != "${HOST}" ]; then
echo "Must be run from ${HOST}"
@ -9,7 +10,7 @@ if [ "$(hostname -s)" != "${HOST}" ]; then
fi
echo "Backup to ${DEST}"
sudo borg create -s --progress "${DEST}::$(date '+%Y%m%d-%H%M')" "${SOURCES[@]}"
sudo borg create -s --progress -e "${EXCLUDE}" "${DEST}::$(date '+%Y%m%d-%H%M')" "${SOURCES[@]}"
echo
echo DONE