code block post

c

There are many variations of passages of Lorem Ipsum available, but the majority have suffered alteration in some form, by injected humour, or randomised words which don’t look even slightly believable. If you are going to use a passage of Lorem Ipsum, you need to be sure there isn’t anything embarrassing hidden in the middle of text. All the Lorem Ipsum generators on the Internet tend to repeat predefined chunks as necessary, making this the first true generator on the Internet. It uses a dictionary of over 200 Latin words, combined with a handful of model sentence structures, to generate Lorem Ipsum which looks reasonable. The generated Lorem Ipsum is therefore always free from repetition, injected humour, or non-characteristic words etc.

#!/bin/bash
 
#set -x # debug, can be commented out
 
timestamp=$(date +"%F")
 
### path array to search ###
dirs=(
      "/xx/yyy/log"
      "/yyy/zzz/trace"
      "/zzz/aaa/dump"
      "/aaa/xxx/yyy/audit"    
)
 
exts=(
        "*.xxx"
        "*.yyy"
        "*.zzz"
)
 
### cleanup params ###
days="1"
 
echo -e "======================= $timestamp ===========================\n"
 
for D in "${dirs[@]}"; do
        echo -e "Entering $D...\n"
          for E in "${exts[@]}"; do
            deletes=$(find "$D" -type f -name "$E" -mtime +"$days")
            count_deletes=$(find "$D" -type f -name "$E" -mtime +"$days" | wc -l)
            echo -e "Found following $E files that are more than $days old:\n$deletes"
            find "$D" -type f -name "$E" -mtime +"$days" -exec rm -rf {} \;
            echo -e "$count_deletes $E files has been deleted\n"
          done  
done
 
echo -e "==============================================================\n"

It uses a dictionary of over 200 Latin words, combined with a handful of model sentence structures, to generate Lorem Ipsum which looks reasonable. The generated Lorem Ipsum is therefore always free from repetition, injected humour, or non-characteristic words etc.

Add Comment

Recent Posts

Pages

Archives

About

middle aged linux nerd. likes coding and pizza. owner of this particular site.