backups exclude *cache*

This commit is contained in:
dctrud 2023-05-18 20:29:44 +01:00
parent 05c8c2921d
commit 53d9be1e5d
4 changed files with 5 additions and 6 deletions

View File

@ -10,7 +10,7 @@ if [ "$(hostname -s)" != "${HOST}" ]; then
fi
echo "Backup to ${DEST}"
sudo borg create -s --progress -e "${EXCLUDE}" "${DEST}::$(date '+%Y%m%d-%H%M')" "${SOURCES[@]}"
sudo borg create -s --progress -e "${EXCLUDE}" -e '*cache*/' "${DEST}::$(date '+%Y%m%d-%H%M')" "${SOURCES[@]}"
echo
echo DONE

View File

@ -10,7 +10,7 @@ if [ "$(hostname -s)" != "${HOST}" ]; then
fi
echo "Backup to ${DEST}"
sudo borg create -s --progress -e "${EXCLUDE}" "${DEST}::$(date '+%Y%m%d-%H%M')" "${SOURCES[@]}"
sudo borg create -s --progress -e "${EXCLUDE}" -e '*cache*/' "${DEST}::$(date '+%Y%m%d-%H%M')" "${SOURCES[@]}"
echo
echo DONE

View File

@ -9,7 +9,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 '*cache*/' "${DEST}::$(date '+%Y%m%d-%H%M')" "${SOURCES[@]}"
echo
echo DONE

View File

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