file changed to new header
This commit is contained in:
parent
00ce405725
commit
f941957bbc
@ -1,29 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
##########################################################################################
|
|
||||||
# .--.
|
|
||||||
# |o_o |
|
|
||||||
# |:_/ |
|
|
||||||
# // \ \
|
|
||||||
# (| | )
|
|
||||||
# /'\_ _/`\
|
|
||||||
# \___)=(___/
|
|
||||||
#
|
|
||||||
# (c) Patrick Asmus
|
|
||||||
# support@media-techport.de
|
|
||||||
# https://www.media-techport.de
|
|
||||||
##########################################################################################
|
|
||||||
# Letzte Anpassung: 19.03.2023
|
|
||||||
# Version 0.0.2
|
|
||||||
##########################################################################################
|
|
||||||
# log-delete.sh
|
|
||||||
##########################################################################################
|
|
||||||
# Set variables
|
|
||||||
LOG_DIR="/var/log"
|
|
||||||
DAYS_TO_KEEP=60
|
|
||||||
|
|
||||||
# Delete old log files
|
|
||||||
find "$LOG_DIR" -type f -mtime +"$DAYS_TO_KEEP" -delete
|
|
||||||
|
|
||||||
# Delete empty log directories
|
|
||||||
find "$LOG_DIR" -type d -empty -delete
|
|
||||||
exit
|
|
22
cleaning/logs-delete.v1.sh
Normal file
22
cleaning/logs-delete.v1.sh
Normal 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
|
||||||
|
# Datum: 02.03.2024
|
||||||
|
# Modifikation: file changed to new header
|
||||||
|
#####################################################
|
||||||
|
|
||||||
|
# Set variables
|
||||||
|
LOG_DIR="/var/log"
|
||||||
|
DAYS_TO_KEEP=60
|
||||||
|
|
||||||
|
# Delete old log files
|
||||||
|
find "$LOG_DIR" -type f -mtime +"$DAYS_TO_KEEP" -delete
|
||||||
|
|
||||||
|
# Delete empty log directories
|
||||||
|
find "$LOG_DIR" -type d -empty -delete
|
||||||
|
exit
|
Loading…
Reference in New Issue
Block a user