Files
rettedpv/rotate.sh
2025-07-23 10:11:00 +02:00

19 lines
829 B
Bash
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

cd /home/oberkoetter/Dokumente/Git/rettedpv
logrotate -s ./logrotate.status ./logrotate.cfg
echo "$(date '+%Y-%m-%d %H:%M:%S') Logrotate fand statt." >>log.txt
echo "$(date '+%Y-%m-%d %H:%M:%S') Packe Archiv-Dateien..." >>log.txt
echo "$(date '+%Y-%m-%d %H:%M:%S') Logrotate fand statt."
echo "$(date '+%Y-%m-%d %H:%M:%S') Packe Archiv-Dateien..."
7z a -mhe=on -mx=9 Archiv.7z Archiv/ >>log.txt || {
echo "Fehler beim Packen. STOPP!"
echo "Fehler beim Packen. STOPP!" >>log.txt
exit 1
}
echo "$(date '+%Y-%m-%d %H:%M:%S') Packen Ok. Lösche Archivdateien..." >>log.txt
echo "$(date '+%Y-%m-%d %H:%M:%S') Packen Ok. Lösche Archivdateien..."
rm -rfv Archiv/* >>log.txt
echo "$(date '+%Y-%m-%d %H:%M:%S') Fertig" >>log.txt
echo "$(date '+%Y-%m-%d %H:%M:%S') Fertig!"