Compare commits

...

3 Commits

Author SHA1 Message Date
scriptos
8077f801ec wording adapted 2024-03-02 15:28:10 +01:00
scriptos
f941957bbc file changed to new header 2024-03-02 15:27:13 +01:00
scriptos
00ce405725 Move to new repository 2024-03-02 15:21:41 +01:00

View File

@ -0,0 +1,22 @@
#!/bin/bash
# Script Name: logs-delete.v1.sh
# Beschreibung: deletes logs that are older than a specified time period
# Aufruf: bash ./logs-delete.v1.sh
# Autor: Patrick Asmus
# Web: https://www.media-techport.de
# Git-Reposit.: https://git.media-techport.de/scriptos/linux-helferlein-scripte.git
# Version: 1.0.1
# Datum: 02.03.2024
# Modifikation: wording adapted
#####################################################
# Variablen
LOG_DIR="/var/log"
DAYS_TO_KEEP=60
# lösche alte Log Files
find "$LOG_DIR" -type f -mtime +"$DAYS_TO_KEEP" -delete
# lösche Verzeichnisse, falls leer
find "$LOG_DIR" -type d -empty -delete
exit