Hallo Herr Demus,
vielen Dank für das Script. Allerdings hat es eine "kleine" Schwachstelle. Stellen Sie sich vor, der Intranator ist kaputt/nicht erreichbar. Es werden erst alle Backups gelöscht bevor die Neuen geholt werden.
Ich poste mal hier unser Referenz-Script für Linux-System:
Code:
wget -o download.log --mirror --no-parent --exclude-directories "*/backup-latest,*/restore" "https://intranator.net.lan/backup/"
RET=$?
if [ $RET -eq 0 ]; then
# download successful
find ./intranator.net.lan/backup/ -mtime +2 -exec rm -f -r \{\} \; >/dev/null 2>&1
else
# output logfile that cron can get it...
cat download.log
fi
rm -f download.log.gz
gzip -9 download.log
exit $RET
Herzliche Grüsse,
Thomas Jarosch