/usr/share/augeas/lenses/dist/tests/test_logrotate.aug is in augeas-lenses 0.10.0-0ubuntu4.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 | module Test_logrotate =
let conf = "# see man logrotate for details
# rotate log files weekly
weekly
# keep 4 weeks worth of backlogs
rotate 4
# create new (empty) log files after rotating old ones
create
# uncomment this if you want your log files compressed
#compress
tabooext + .old .orig .ignore
# packages drop log rotation information into this directory
include /etc/logrotate.d
# no packages own wtmp, or btmp -- we'll rotate them here
/var/log/wtmp
/var/log/wtmp2
{
missingok
monthly
create 0664 root utmp
rotate 1
}
/var/log/btmp /var/log/btmp* {
missingok
# ftpd doesn't handle SIGHUP properly
monthly
create 0664 root utmp
rotate 1
}
/var/log/vsftpd.log {
# ftpd doesn't handle SIGHUP properly
nocompress
missingok
notifempty
rotate 4
weekly
}
/var/log/apache2/*.log {
weekly
missingok
rotate 52
compress
delaycompress
notifempty
create 640 root adm
sharedscripts
prerotate
if [ -f /var/run/apache2.pid ]; then
/etc/init.d/apache2 restart > /dev/null
fi
endscript
}
"
test Logrotate.lns get conf =
{ "#comment" = "see man logrotate for details" }
{ "#comment" = "rotate log files weekly" }
{ "schedule" = "weekly" }
{}
{ "#comment" = "keep 4 weeks worth of backlogs" }
{ "rotate" = "4" }
{}
{ "#comment" = "create new (empty) log files after rotating old ones" }
{ "create" }
{}
{ "#comment" = "uncomment this if you want your log files compressed" }
{ "#comment" = "compress" }
{}
{ "tabooext" = "+" { ".old" } { ".orig" } { ".ignore" } }
{}
{ "#comment" = "packages drop log rotation information into this directory" }
{ "include" = "/etc/logrotate.d" }
{}
{ "#comment" = "no packages own wtmp, or btmp -- we'll rotate them here" }
{ "rule"
{ "file" = "/var/log/wtmp" }
{ "file" = "/var/log/wtmp2" }
{ "missingok" = "missingok" }
{ "schedule" = "monthly" }
{ "create"
{ "mode" = "0664" }
{ "owner" = "root" }
{ "group" = "utmp" } }
{ "rotate" = "1" } }
{}
{ "rule"
{ "file" = "/var/log/btmp" }
{ "file" = "/var/log/btmp*" }
{ "missingok" = "missingok" }
{ "#comment" = "ftpd doesn't handle SIGHUP properly" }
{ "schedule" = "monthly" }
{ "create"
{ "mode" = "0664" }
{ "owner" = "root" }
{ "group" = "utmp" } }
{ "rotate" = "1" } }
{ "rule"
{ "file" = "/var/log/vsftpd.log" }
{ "#comment" = "ftpd doesn't handle SIGHUP properly" }
{ "compress" = "nocompress" }
{ "missingok" = "missingok" }
{ "ifempty" = "notifempty" }
{ "rotate" = "4" }
{ "schedule" = "weekly" } }
{}
{ "rule"
{ "file" = "/var/log/apache2/*.log" }
{ "schedule" = "weekly" }
{ "missingok" = "missingok" }
{ "rotate" = "52" }
{ "compress" = "compress" }
{ "delaycompress" = "delaycompress" }
{ "ifempty" = "notifempty" }
{ "create"
{ "mode" = "640" }
{ "owner" = "root" }
{ "group" = "adm" } }
{ "sharedscripts" = "sharedscripts" }
{ "prerotate" = " if [ -f /var/run/apache2.pid ]; then
/etc/init.d/apache2 restart > /dev/null
fi" } }
test Logrotate.lns get "/var/log/file {\n dateext\n}\n" =
{ "rule"
{ "file" = "/var/log/file" }
{ "dateext" = "dateext" } }
(* Make sure 'minsize 1M' works *)
test Logrotate.lns get "/avr/log/wtmp {\n minsize 1M\n}\n" =
{ "rule"
{ "file" = "/avr/log/wtmp" }
{ "minsize" = "1M" } }
(* '=' is a legal separator, file names can be indented *)
test Logrotate.lns get " \t /file {\n size=5M\n}\n" =
{ "rule"
{ "file" = "/file" }
{ "size" = "5M" } }
(* Can leave owner/group off a create statement *)
test Logrotate.lns get "/file {
create 600\n}\n" =
{ "rule"
{ "file" = "/file" }
{ "create"
{ "mode" = "600" } } }
test Logrotate.lns put "/file {\n create 600\n}\n" after
set "/rule/create/owner" "user"
= "/file {\n create 600 user\n}\n"
(* The newline at the end of a script is optional *)
test Logrotate.lns put "/file {\n size=5M\n}\n" after
set "/rule/prerotate" "\tfoobar"
=
"/file {
size=5M
\tprerotate
\tfoobar
\tendscript\n}\n"
test Logrotate.lns put "/file {\n size=5M\n}\n" after
set "/rule/prerotate" "\tfoobar\n"
=
"/file {
size=5M
\tprerotate
\tfoobar\n
\tendscript\n}\n"
(* Bug #101: whitespace at the end of the line *)
test Logrotate.lns get "/file {\n missingok \t\n}\n" =
{ "rule"
{ "file" = "/file" }
{ "missingok" = "missingok" } }
(* Bug #104: file names can be separated by newlines *)
let conf2 = "/var/log/mail.info
/var/log/mail.warn
/var/log/mail.err
{
weekly
}
"
test Logrotate.lns get conf2 =
{ "rule"
{ "file" = "/var/log/mail.info" }
{ "file" = "/var/log/mail.warn" }
{ "file" = "/var/log/mail.err" }
{ "schedule" = "weekly" } }
|