File: logrotate

package info (click to toggle)
php-codeigniter-framework 3.1.13%2Bdfsg1-7
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 6,228 kB
  • sloc: php: 37,178; xml: 205; makefile: 138; python: 66; sh: 65
file content (30 lines) | stat: -rw-r--r-- 829 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# Inspired by
# https://stackoverflow.com/questions/17402464/how-to-create-logrotate-in-linux

# We don't use "create", so that codeigniter will create itself the new log file
# with the correct header in it (if we create the file, the header won't be in it)

/var/log/php-codeigniter-framework/log.log {
    daily
    missingok
    rotate 14
    compress
    delaycompress
    notifempty
    #create 644 www-data www-data
    sharedscripts
    dateext
    dateformat -%Y-%m-%d-%s
    extension .php

    postrotate
        if invoke-rc.d apache2 status > /dev/null 2>&1; then \
            invoke-rc.d apache2 reload > /dev/null 2>&1; \
        fi;
    endscript
    prerotate
        if [ -d /etc/logrotate.d/httpd-prerotate ]; then \
                run-parts /etc/logrotate.d/httpd-prerotate; \
        fi; \
    endscript
}