Skip to content

Commit 8fa7e58

Browse files
committed
Backups now exclude the backup location by default.
1 parent e6c180b commit 8fa7e58

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

scripts/backup.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,9 @@ function create_backup {
7575
command+=("--exclude=$CWD")
7676
fi
7777

78+
# Exclude the Backup Location directory.
79+
command+=("--exclude=$BACKUP_LOC")
80+
7881

7982
# Create the backup as a compressed tar archive
8083
# -c creates a tar archived file
@@ -94,7 +97,7 @@ function create_backup {
9497
BACKUP_FILENAME="${FILENAME_PREFIX}${BACKUP_TIMESTAMP//[ ]/_}"
9598

9699
# The destination where the backup file will be stored.
97-
BACKUP_DESTINATION="${BACKUP_LOC}${BACKUP_FILENAME}.tar.gz"
100+
BACKUP_DESTINATION="${BACKUP_LOC}/${BACKUP_FILENAME}.tar.gz"
98101

99102
# Adding backup destination to command.
100103
command+=("$BACKUP_DESTINATION")

0 commit comments

Comments
 (0)