3 Commits
Author SHA1 Message Date
Hartmut Bauer 15f77b6bf5 1st step to podman 2025-04-29 22:56:18 +02:00
Hartmut Bauer 42af16928f weekly SA->SO 2025-04-29 15:28:51 +02:00
Hartmut Bauer 39bdfbd021 bugfix 2025-04-15 22:49:29 +02:00
4 changed files with 27 additions and 13 deletions

No files matched your search

+2 -2
View File
@@ -14,12 +14,12 @@ backup_daily2() {
before_backup() {
stop_docker
stop_containers
return $?
}
after_backup() {
start_docker
start_containers
local dock=$?
copy_to_nas "$BACKUP_TARGET" "$NAS_TARGET"
local copy=$?
+19 -8
View File
@@ -1,5 +1,6 @@
HOST_NAME=$(hostname -s)
DAY=$(date +%u) # MO == 1
DAY=$(date +%u) # 1-7, MO is 1
WEEKLY_DAY=7 # SA->SO
NAS_MOUNT_POINT="$(realpath $HERE/../../..)" # Server/bin/backup
NAS_ROOT="$NAS_MOUNT_POINT/backups"
@@ -17,8 +18,6 @@ NAS_HOSTNAME=synology
NAS_IP=10.4.2.20
NAS_SCRIPT=/volume1/nfs/Server/bin/backup/main.sh
WEEKLY_DAY=1 # SO->MO
PASSPHRASE=L1rfCXu8PHMQsGL0HJWwzQYpCT7f5VboislOTHMaEV
EXT=tgz.gpg
LIST_EXT=list
@@ -141,18 +140,30 @@ check_root() {
fi
}
start_docker() {
log $DEBUG "$DBG start_docker()"
start_containers() {
log $DEBUG "$DBG start_containers()"
if [ -f /var/docker/run/docker-compose.yml ]; then
log $DEBUG "$DBG > \$DOCKER up -d"
$DOCKER up -d >>$LOG_FILE 2>&1
return $?
else
log $DEBUG "$DBG > sudo systemctl start pihole"
sudo systemctl start pihole >>$LOG_FILE 2>&1
return $?
fi
}
stop_docker() {
stop_containers() {
log $DEBUG "$DBG stop_docker()"
if [ -f /var/docker/run/docker-compose.yml ]; then
log $DEBUG "$DBG > \$DOCKER down"
$DOCKER down >>$LOG_FILE 2>&1
return $?
else
log $DEBUG "$DBG > sudo systemctl stop pihole"
sudo systemctl stop pihole >>$LOG_FILE 2>&1
return $?
fi
}
# Zugriffsrechte für Logs und Backups setzen
@@ -855,8 +866,8 @@ do_export() {
mail_log $INFO ">>> "
mail_log $INFO "$INF exporting $source_path -> $mount_point"
log $DEBUG "$DBG rsync -rti --one-file-system --delete --stats --exclude=@eaDir --exclude=.$LIST_EXT $source_path $mount_point"
rsync -rti --one-file-system --delete --stats --exclude=@eaDir --exclude=.$LIST_EXT $source_path $mount_point >>$LOG_FILE 2>&1
log $DEBUG "$DBG rsync -rti --one-file-system --delete --stats --exclude=@eaDir --exclude='*'.$LIST_EXT $source_path $mount_point"
rsync -rti --one-file-system --delete --stats --exclude=@eaDir --exclude='*'.$LIST_EXT $source_path $mount_point >>$LOG_FILE 2>&1
is_error $?
mail_log $INFO "$INF unmounting USB device $device."
+4 -1
View File
@@ -3,7 +3,10 @@
# entrypoint for all actions
#
VER="2.1.5"
# 2.1.7 29.04.2025 - 1. Schritt zur Umstellung auf podman
# 2.1.6 29.04.2025 - weekly backup Sa->SO
VER="2.1.7"
HERE=$(dirname "$0")
THIS_SCRIPT=$0
+2 -2
View File
@@ -28,12 +28,12 @@ before_backup() {
if [ $mys -gt 0 ] || [ $pos -gt 0 ]; then
return 1
fi
stop_docker
stop_containers
return $?
}
after_backup() {
start_docker
start_containers
local dock=$?
copy_to_nas "$BACKUP_TARGET" "$NAS_TARGET"
local copy=$?