Discussion on:

6
Comments

Join the conversation!

Follow via:
RSS
Email Alert
How does logrotate know which file to rotate?
0 Votes
+ -
/etc/logrotate.d/syslog for that subsystem and in it, there is a list of files. /etc/logrotate.d has other subsystems it can/does manage.
All the above is fine.. can be implemented.. but my basic question is, once the logs are rotated... where does the copy of that log file go if option of email is not enabled ..... Mean Which Directory of the LINUX SYSTEM...
Is their a way we can specify a Directory where we want the logs file to be saved after rotation?.
0 Votes
+ -
Inside the logrotate.conf

add this line:
olddir /var/log/stored_logs

You need to create the 'stored_logs' directory or whatever you want to name it.

It will rotate the logs into this one for keeping.

Also, if you put compress it will gzip the files

so have
compress
olddir /var/log/stored_logs
Lots of help. New to Linux so didn't know how to use cronjob. Numerous errors so need to do some troubleshooting to clean up the errors although it did work.
I implemented logrotate by following the steps above, but I am receiving an error that reads: "error: /etc/logrotate.conf:47 duplicate log entry for /var/log/messages"

I saw this error after doing a /usr/sbin/logrotate -d /etc/logrotate.conf. Does anyone have any idea how I can remedy this?
Keyboard Shortcuts:
Prev
Next
Toggle
Join the conversation
Formatting +
BB Codes - Note: HTML is not supported in forums
  • [b] Bold [/b]
  • [i] Italic [/i]
  • [u] Underline [/u]
  • [s] Strikethrough [/s]
  • [q] "Quote" [/q]
  • [ol][*] 1. Ordered List [/ol]
  • [ul][*] · Unordered List [/ul]
  • [pre] Preformat [/pre]
  • [quote] "Blockquote" [/quote]

Join the TechRepublic Community and join the conversation! Signing-up is free and quick, Do it now, we want to hear your opinion.