# atop logrotate configuration file

/var/log/atop/atop.log {
    rotate 14
    daily
    nocompress
    nocreate
    missingok
    dateext
    dateyesterday
    prerotate
        if pidof atop 2>&1 > /dev/null; then
            {% if grains['fqdn'] == 'cloud01sas.mds.yandex.net' -%}
            /bin/kill $(pidof atop)
            {% else -%}
            /usr/sbin/invoke-rc.d --quiet atop stop 2>&1 > /dev/null
            {%- endif %}
        fi
    endscript
    postrotate
        /usr/sbin/invoke-rc.d --quiet atop start 2>&1 > /dev/null
    endscript
}
