[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[Git][ftp-team/dak][master] Rotate cronscripts logs



Title: GitLab

Joerg Jaspert pushed to branch master at Debian FTP Team / dak

Commits:

  • 95825779
    by Joerg Jaspert at 2023-06-12T22:20:00+02:00
    Rotate cronscripts logs
    
    Configurable per variable (override in local vars file), we keep (by
    default) only 60 days
    

2 changed files:

Changes:

  • config/common/variables
    ... ... @@ -35,6 +35,9 @@ PATH=${masterdir}:${PATH}
    35 35
     # By default, add no timestamps to stage logs
    
    36 36
     TIMESTAMP=false
    
    37 37
     
    
    38
    +# How many days of logfiles to keep?
    
    39
    +declare -r logkeep=${logkeep:-60}
    
    40
    +
    
    38 41
     declare -r HOSTNAME=$(hostname -s)
    
    39 42
     
    
    40 43
     # where do we want mails to go? For example log entries made with error()
    

  • config/debian/cronscript
    ... ... @@ -287,6 +287,9 @@ function laststeps() {
    287 287
         # and ensure its no longer used
    
    288 288
         exec > "$logdir/after${PROGRAM}.log" 2>&1
    
    289 289
     
    
    290
    +    # Rotate out old logfiles
    
    291
    +    find ${logdir}/${PROGRAM}_*.log.bz2 -mtime +${logkeep} -delete
    
    292
    +
    
    290 293
         # Now, at the very (successful) end of this run, make sure we remove
    
    291 294
         # our stage files, so the next script run will do it all again.
    
    292 295
         if [[ ${successval} -eq 0 ]]; then
    


  • Reply to: