borg2-backup-nc.sh: don't backup log files.

This commit is contained in:
Christoph 2025-03-09 01:11:24 +01:00
parent 079fd850e6
commit dc8a847990

View File

@ -756,50 +756,62 @@ fi
echononl "Create borg backup.." echononl "Create borg backup.."
cat << EOF >> ${BORG_LOG_FILE} cat << EOF >> ${BORG_LOG_FILE}
borg2 \\ borg2 \\
--remote-path borg2 \\ --remote-path borg2 \\
--repo ${BORG_URL} \\ --repo ${BORG_URL} \\
create \\ create \\
--verbose \\ --verbose \\
--filter AME \\ --filter AME \\
--list \\ --list \\
--stats \\ --stats \\
--show-rc \\ --show-rc \\
--compression lz4 \\ --compression lz4 \\
--exclude-caches \\ --exclude-caches \\
--exclude 'home/*/.cache/*' \\ --exclude 'home/*/.cache/*' \\
--exclude '/root/.cache/*' \\ --exclude '/root/.cache/*' \\
--exclude '/root/.config/*' \\ --exclude '/root/.config/*' \\
--exclude '/root/.local/*' \\ --exclude '/root/.local/*' \\
--exclude 'var/tmp/*' \\ --exclude '**/tmp/*' \\
${ARCHIVE_NAME} \\ --exclude '*.lock' \\
${NC_DB_BACKUP_DIR} \\ --exclude '*.log' \\
${BORG_NC_PATH} \\ --exclude '*.log.[0-9]' \\
${NC_DATA_DIR} \\ --exclude '*.log.[0-9]*.gz' \\
--exclude '**/sessions/*' \\
--exclude '**/*.20[2-3][0-9]-[0-1][0-9]*' \\
${ARCHIVE_NAME} \\
${NC_DB_BACKUP_DIR} \\
${BORG_NC_PATH} \\
${NC_DATA_DIR} \\
${BORG_BACKUP_DIRS} ${BORG_BACKUP_DIRS}
EOF EOF
borg2 \ borg2 \
--remote-path borg2 \ --remote-path borg2 \
--repo ${BORG_URL} \ --repo ${BORG_URL} \
create \ create \
--verbose \ --verbose \
--filter AME \ --filter AME \
--list \ --list \
--stats \ --stats \
--show-rc \ --show-rc \
--compression lz4 \ --compression lz4 \
--exclude-caches \ --exclude-caches \
--exclude 'home/*/.cache/*' \ --exclude 'home/*/.cache/*' \
--exclude '/root/.cache/*' \ --exclude '/root/.cache/*' \
--exclude '/root/.config/*' \ --exclude '/root/.config/*' \
--exclude '/root/.local/*' \ --exclude '/root/.local/*' \
--exclude 'var/tmp/*' \ --exclude '**/tmp/*' \
${ARCHIVE_NAME} \ --exclude '*.lock' \
${NC_DB_BACKUP_DIR} \ --exclude '*.log' \
${BORG_NC_PATH} \ --exclude '*.log.[0-9]' \
${NC_DATA_DIR} \ --exclude '*.log.[0-9]*.gz' \
${BORG_BACKUP_DIRS} \ --exclude '**/sessions/*' \
--exclude '**/*.20[2-3][0-9]-[0-1][0-9]*' \
${ARCHIVE_NAME} \
${NC_DB_BACKUP_DIR} \
${BORG_NC_PATH} \
${NC_DATA_DIR} \
${BORG_BACKUP_DIRS} \
> ${log_file} 2>&1 > ${log_file} 2>&1