2 Commits
Author SHA1 Message Date
Hartmut Bauer 56f7e63f9e fix tar param wg. macOS 2026-01-26 16:21:33 +01:00
Hartmut Bauer c5648a9694 fix tar cmd line again 2025-12-21 03:20:26 +01:00
3 changed files with 25 additions and 7 deletions

No files matched your search

+6 -4
View File
@@ -456,7 +456,7 @@ backup_all_dirs() {
# #
# $1 - Pfad zum Verzeichnis, das gesichert werden soll # $1 - Pfad zum Verzeichnis, das gesichert werden soll
# $2 - Zielpfad und -name für das Archiv # $2 - Zielpfad und -name für das Archiv
# $2 - zu sicherndes Verzeichnis # $3 - zu sicherndes Verzeichnis
# #
# returns 0 for success, 1 otherwise # returns 0 for success, 1 otherwise
# #
@@ -482,7 +482,7 @@ backup_directory() {
# #
# $1 - Pfad zum Verzeichnis, das gesichert werden soll # $1 - Pfad zum Verzeichnis, das gesichert werden soll
# $2 - Zielpfad und -name für das Archiv # $2 - Zielpfad und -name für das Archiv
# $2 - zu sicherndes Verzeichnis # $3 - zu sicherndes Verzeichnis
# #
# returns 0 for success, 1 otherwise # returns 0 for success, 1 otherwise
# #
@@ -492,11 +492,13 @@ tar_dir() {
local archive=$2 local archive=$2
local dir=$3 local dir=$3
local sort=--sort=name local sort=--sort=name
local tar_warn=--warning=no-file-ignored
if [[ "$(uname)" == "Darwin" ]]; then if [[ "$(uname)" == "Darwin" ]]; then
sort="" sort=""
tar_warn=""
fi fi
log $DEBUG "$DBG > tar -c -z --warning=\"no-file-ignored\" --numeric-owner --one-file-system $sort --exclude \"@eaDir\" -C \"$root\" \"$dir\" | gpg --batch -c --passphrase xxxx -o \"$archive\"" log $DEBUG "$DBG > tar -c -z $tar_warn --numeric-owner --one-file-system $sort --exclude \"@eaDir\" -C \"$root\" \"$dir\" | gpg --batch -c --passphrase xxxx -o \"$archive\""
tar -c -z--warning="no-file-ignored" --numeric-owner --one-file-system $sort --exclude "@eaDir" -C "$root" "$dir" 2>>$LOG_FILE | gpg --batch -c --passphrase $PASSPHRASE -o "$archive" 2>>$LOG_FILE tar -c -z $tar_warn --numeric-owner --one-file-system $sort --exclude "@eaDir" -C "$root" "$dir" 2>>$LOG_FILE | gpg --batch -c --passphrase $PASSPHRASE -o "$archive" 2>>$LOG_FILE
check_pipe_rc ${PIPESTATUS[@]} check_pipe_rc ${PIPESTATUS[@]}
return $? return $?
} }
+6 -2
View File
@@ -3,7 +3,11 @@
# entrypoint for all actions # entrypoint for all actions
# #
# 2.3.5. 20.12.2025 - fix not only logging but tar command itself # 2.3.9 26.01.2026 - fix: tar param ohne Anführungszeichen
# 2.3.8 25.01.2026 - fix tar parameter (--warning on macOS not available)
# 2.3.7 21.12.2025 - container/.local wird jetzt tatsächlich übersprungen
# 2.3.6 21.12.2025 - another fix for the tar command
# 2.3.5 20.12.2025 - fix not only logging but tar command itself
# 2.3.4 19.12.2025 - fix tar param: --warning="no-file-ignored" # 2.3.4 19.12.2025 - fix tar param: --warning="no-file-ignored"
# 2.3.3 18.12.2025 - smtp-relay läuft durch, dadurch ändern sich ggf. Dateien im Container, was # 2.3.3 18.12.2025 - smtp-relay läuft durch, dadurch ändern sich ggf. Dateien im Container, was
# zu Fehlern beim tar führt. Deshalb wird das Verzeichnis # zu Fehlern beim tar führt. Deshalb wird das Verzeichnis
@@ -35,7 +39,7 @@
# 2.1.7 29.04.2025 - 1. Schritt zur Umstellung auf podman # 2.1.7 29.04.2025 - 1. Schritt zur Umstellung auf podman
# 2.1.6 29.04.2025 - weekly backup Sa->SO # 2.1.6 29.04.2025 - weekly backup Sa->SO
VER="2.3.5" VER="2.3.9"
HERE=$(dirname "$0") HERE=$(dirname "$0")
THIS_SCRIPT=$0 THIS_SCRIPT=$0
+13 -1
View File
@@ -10,7 +10,7 @@ NAS_TARGET="$NAS_ROOT/daily/$HOST_NAME/backup.$DAY"
backup_daily1() { backup_daily1() {
BACKUP_SOURCE="/var" BACKUP_SOURCE="/var"
BACKUP_EXCLUDE_DIRS=(containers home/container/.local/share/containers) BACKUP_EXCLUDE_DIRS=(containers home)
} }
backup_daily2() { backup_daily2() {
@@ -23,6 +23,18 @@ backup_daily3() {
BACKUP_EXCLUDE_DIRS=() BACKUP_EXCLUDE_DIRS=()
} }
backup_daily4() {
BACKUP_SOURCE="/var/home"
BACKUP_EXCLUDE_DIRS=(container)
}
backup_daily5() {
BACKUP_SOURCE="/var/home/container"
# wg. Problemen mit container/.local/share/containers/storage
BACKUP_EXCLUDE_DIRS=(.local)
}
before_backup() { before_backup() {
let local rc=0 let local rc=0