parent
8b5dd8ac74
commit
253e705fc6
1 changed files with 4 additions and 0 deletions
|
@ -5,6 +5,10 @@ log () {
|
||||||
|
|
||||||
logfileSetup () {
|
logfileSetup () {
|
||||||
logFileName="$scriptName-$(date +"%Y_%m_%d_%I_%M_%p").txt"
|
logFileName="$scriptName-$(date +"%Y_%m_%d_%I_%M_%p").txt"
|
||||||
|
|
||||||
|
# delete log files older than 5 days
|
||||||
|
find "/config/logs" -type f -iname "$scriptName-*.txt" -mtime +5 -delete
|
||||||
|
|
||||||
if [ ! -f "/config/logs/$logFileName" ]; then
|
if [ ! -f "/config/logs/$logFileName" ]; then
|
||||||
echo "" > "/config/logs/$logFileName"
|
echo "" > "/config/logs/$logFileName"
|
||||||
chmod 666 "/config/logs/$logFileName"
|
chmod 666 "/config/logs/$logFileName"
|
||||||
|
|
Loading…
Reference in a new issue