Move to new repository
This commit is contained in:
parent
01dbe7c3e9
commit
00ce405725
29
cleaning/logs-delete.sh
Normal file
29
cleaning/logs-delete.sh
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
#!/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
|
Loading…
Reference in New Issue
Block a user