Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
15f77b6bf5 | ||
|
|
42af16928f | ||
|
|
39bdfbd021 |
No files matched your search
+2
-2
@@ -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
@@ -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."
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in new issue
Block a user