mirror of https://github.com/Chizi123/Scripts.git

Joel Grunbaum
2021-03-11 af5c53dbc066eb9f5133386dac0a7072eb4ecb13
Excludes in own variable, exclude backups
1 files modified
11 ■■■■ changed files
backup.sh 11 ●●●● patch | view | raw | blame | history
backup.sh
@@ -4,6 +4,7 @@
FILES_DIR="/home/joel/OneDrive/"
RCLONE_BACKUP=("GoogleDrive" "Mega" "unimelb" "pCloud" "gdrive_unimelb" "NC_home" "NextCloud")
RCLONE_FILES=("Mega" "unimelb" "gdrive_unimelb" "NC_home")
EXCLUDES="--exclude '*~' --exclude '*#*' --exclude '.DS_Store' --exclude '*.7z' "
function sync() {
    case $1 in
@@ -47,20 +48,18 @@
    sync_all p
    exit
elif [ "$1" = "cron" ]; then
    borg create \
    borg create \
     --compression zstd,22 \
     --exclude '*~' \
     --exclude '*#*' \
     $EXCLUDES \
     \
     $BACKUP_DIR::"$(date +%F+%R)" \
     $FILES_DIR
else
    borg create \
    borg create \
     --verbose \
     --stats \
     --compression zstd,22 \
     --exclude '*~' \
     --exclude '*#*' \
     $EXCLUDES \
     \
     $BACKUP_DIR::"$(date +%F+%R)" \
     $FILES_DIR