Changeset 58720a7b for general/sysutils
- Timestamp:
- 07/09/2014 01:52:45 AM (10 years ago)
- Branches:
- 10.0, 10.1, 11.0, 11.1, 11.2, 11.3, 12.0, 12.1, 7.10, 7.6, 7.6-blfs, 7.6-systemd, 7.7, 7.8, 7.9, 8.0, 8.1, 8.2, 8.3, 8.4, 9.0, 9.1, basic, bdubbs/svn, elogind, kde5-13430, kde5-14269, kde5-14686, kea, ken/TL2024, ken/inkscape-core-mods, ken/tuningfonts, krejzi/svn, lazarus, lxqt, nosym, perl-modules, plabs/newcss, plabs/python-mods, python3.11, qt5new, rahul/power-profiles-daemon, renodr/vulkan-addition, systemd-11177, systemd-13485, trunk, upgradedb, xry111/intltool, xry111/llvm18, xry111/soup3, xry111/test-20220226, xry111/xf86-video-removal
- Children:
- 30fe7dd
- Parents:
- 8abba5b9
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
general/sysutils/logrotate.xml
r8abba5b9 r58720a7b 173 173 174 174 # End of /etc/logrotate.conf 175 EOF</userinput></screen> 175 EOF 176 177 chmod -v 0644 /etc/logrotate.conf</userinput></screen> 176 178 177 179 <para>Now create the <filename class='directory'>/etc/logrotate.d</filename> … … 185 187 186 188 <screen role="root"><userinput>cat > /etc/logrotate.d/sys.log << EOF 187 sys.log {189 /var/log/sys.log { 188 190 # If the log file is larger than 100kb, rotate it 189 191 size 100k … … 194 196 endscript 195 197 } 196 EOF</userinput></screen> 197 198 <para>See the logrotate man page or 198 EOF 199 200 chmod -v 0644 /etc/logrotate.d/sys.log</userinput></screen> 201 202 <para>You can designate multiple files in one entry:</para> 203 204 <screen role="root"><userinput>cat > /etc/logrotate.d/example.log << EOF 205 file1 206 file2 207 file3 { 208 ... 209 postrotate 210 ... 211 endscript 212 } 213 EOF 214 215 chmod -v 0644 /etc/logrotate.d/example.log</userinput></screen> 216 217 <para>You can use in the same line the list of files: file1 file2 file3. 218 See the logrotate man page or 199 219 <ulink url='http://www.techrepublic.com/article/manage-linux-log-files-with-logrotate/'/> 200 220 for more examples.</para> 201 221 202 222 <para>The command <command>logrotate /etc/logrotate.conf</command> can be 203 run manually, however, the command should be run daily. 204 To set up <xref linkend='fcron'/> to run at 3AM daily, root's crontab 205 should be edited to add:</para> 223 run manually, however, the command should be run daily. 224 Other useful commands are <command>logrotate -d /etc/logrotate.conf</command> 225 for debugging purposes and <command>logrotate -f /etc/logrotate.conf</command> 226 forcing the logrotate commands to be run immediately. Combining the previous 227 options <option>-df</option>, you can debug the effect of the force command. 228 When debugging, the command is only simulated, not really run, thus, eventual 229 non-existing errors appear, when some intermediate files are expected, 230 because they are not actually created.</para> 231 232 <para>To set up <xref linkend='fcron'/> to run 233 <command>logrotate ...</command> at 3AM daily, root's crontab should be 234 edited to add:</para> 206 235 207 236 <screen><literal>0 3 * * * /usr/sbin/logrotate /etc/logrotate.conf</literal></screen>
Note:
See TracChangeset
for help on using the changeset viewer.