Skip to content
A couple of scripts to use to point logrotate at Swift.
Shell Python
Branch: master
Clone or download

Latest commit

Fetching latest commit…
Cannot retrieve the latest commit at this time.

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.swiftrotate.example
README.md
prerotate.py
requirements.txt
swiftrotate.sh

README.md

swiftrotate

Adventures in Logrotate and swift.

  • prerotate.py - Utility script which datestamps a collection of files that have been logrotated, but were rotated without dateext.
  • swiftrotate.sh - Script to add to to logrotate.conf postrotate.
  • .swiftrotate.example - Contains example configuration values required by swiftrotate.sh

Just add the full path to swiftrotate.sh to the postrotate directive.

Example logrotate configuration for fail2ban:

/var/log/fail2ban.log {
    daily
    rotate 4
    dateext
    compress

    delaycompress
    missingok
    postrotate
        fail2ban-client set logtarget /var/log/fail2ban.log >/dev/null
        /usr/local/bin/swiftrotate.sh
    endscript
    create 640 root adm
    }

Force logrotate:

	sudo /usr/sbin/logrotate -dv --force /etc/logrotate.conf
You can’t perform that action at this time.