"Fossies" - the Fresh Open Source Software Archive

Member "mosshe/cron.daily_logrotate-mosshe" (11 Mar 2015, 727 Bytes) of package /linux/privat/old/mosshe.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Bash source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    1 #!/bin/sh
    2 
    3 # first compress
    4 
    5 # monthly
    6 find /var/log/mosshe -mtime +4  -type f \
    7         -name "mosshe_log.[0-9][0-9][0-9][0-9]-[0-9][0-9]" \
    8         -exec bzip2 {} \;
    9 
   10 # weekly
   11 find /var/log/mosshe -mtime +4  -type f \
   12         -name "mosshe_log.[0-9][0-9][0-9][0-9]kw[0-9]" \
   13         -exec bzip2 {} \;
   14 
   15 find /var/log/mosshe -mtime +4  -type f \
   16         -name "mosshe_log.[0-9][0-9][0-9][0-9]kw[0-9][0-9]" \
   17         -exec bzip2 {} \;
   18 
   19 #daily
   20 find /var/log/mosshe -mtime +4  -type f \
   21         -name "mosshe_log.[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]" \
   22         -exec bzip2 {} \;
   23 
   24 
   25 
   26 # then delete files older than 2 months
   27 
   28 find /var/log/mosshe -mtime +60  -type f \
   29         -name "mosshe_log.*.bz2" \
   30         -exec rm {} \;