summarylogtreecommitdiffstats
path: root/dragonfly.logrotate
blob: f8f9270c1ffb33fbdcb5cae84a0ea4276590806b (plain)
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
# installed by debhelper by convention into /etc/logrotate.d/

/var/log/dragonfly/dragonfly*.log {
        daily
        missingok

        compress
        compresscmd zstd
        uncompresscmd unzstd
        compressext .zst
        notifempty

# do not create an empty file after the rotation.
        nocreate
        prerotate
                if lsof -t $1 > /dev/null; then
                # file is open. Skipping rotation."
                exit 0
                fi
        endscript

# Possible hook to upload rotated logs to cloud storage.
        postrotate
                echo "TBD: POSTROTATE"
        endscript
}