hi all, In my system /var/log all syslog files are accumulating.Is there any way to delete files automatically. vijay
Theres a product called 'logrotate' that performs this task. Though not related to syslog-ng in any way. -Patrick Sent: Wed Nov 10 2010 09:58:23 GMT-0700 (Mountain Standard Time) From: vijay <bhaskarpeddi@gmail.com> To: Syslog-ng users' and developers' mailing list <syslog-ng@lists.balabit.hu> Subject: [syslog-ng] clearing log files
hi all, In my system /var/log all syslog files are accumulating.Is there any way to delete files automatically.
vijay ______________________________________________________________________________ Member info: https://lists.balabit.hu/mailman/listinfo/syslog-ng Documentation: http://www.balabit.com/support/documentation/?product=syslog-ng FAQ: http://www.campin.net/syslog-ng/faq.html
Theres a product called 'logrotate' that performs this task. Though not related to syslog-ng in any way.
It is also possible to do it with syslog-ng, to some extent: using macros one can set up a destination that delivers messages, to say, /var/log/messages-$MONTH.log (and thus, logs will start accumulating in a new file every month, and rotating each year), or if more frequent "clearing" is required, /var/log/messages-$DAY.log works too. For example, this destination would accomplish something like this: destination d_monthly { file("/var/log/messages-$MONTH.log"); }; The downside of this is that logs aren't archived, and are overwritten. logrotate and similar tools can save the old logs and archive them, if so need be. The administrator guide has an extensive list of available macros: http://www.balabit.com/sites/default/files/documents/syslog-ng-ose-v3.1-guid...
From: Gergely Nagy <algernon@madhouse-project.org>
The downside of this is that logs aren't archived, and are overwritten. logrotate and similar tools can save the old logs and archive them, if so need be. Actually this wont solve it, syslog-ng wont overwrite logs, it will only append to them.
Actually this wont solve it, syslog-ng wont overwrite logs, it will only append to them.
You're correct - overwrite_if_older() is also needed (the admin docs even list simple log rotation as an example when talking about this option).
This is what I am using for my /etc/logrotate.d/syslog-ng script. Feel free to alter as needed. /var/log/syslog/apache/*/*.log /var/log/syslog/general/*/*.log /var/log/syslog/weblogic/*/*.log { missingok create 644 root root notifempty copytruncate compress rotate 1 } ________________________________________ From: syslog-ng-bounces@lists.balabit.hu [syslog-ng-bounces@lists.balabit.hu] On Behalf Of Gergely Nagy [algernon@madhouse-project.org] Sent: Wednesday, November 10, 2010 12:58 PM To: Syslog-ng users' and developers' mailing list Subject: Re: [syslog-ng] clearing log files
Actually this wont solve it, syslog-ng wont overwrite logs, it will only append to them.
You're correct - overwrite_if_older() is also needed (the admin docs even list simple log rotation as an example when talking about this option). ______________________________________________________________________________ Member info: https://lists.balabit.hu/mailman/listinfo/syslog-ng Documentation: http://www.balabit.com/support/documentation/?product=syslog-ng FAQ: http://www.campin.net/syslog-ng/faq.html CONFIDENTIALITY NOTICE: This email and any attachments are intended solely for the use of the named recipient(s). This email may contain confidential and/or proprietary information of Scientific Research Corporation. If you are not a named recipient, you are prohibited from reviewing, copying, using, disclosing or distributing to others the information in this email and attachments. If you believe you have received this email in error, please notify the sender immediately and permanently delete the email, any attachments, and all copies thereof from any drives or storage media and destroy any printouts of the email or attachments. EXPORT COMPLIANCE NOTICE: This email and any attachments may contain technical data subject to U.S export restrictions under the International Traffic in Arms Regulations (ITAR) or the Export Administration Regulations (EAR). Export or transfer of this technical data and/or related information to any foreign person(s) or entity(ies), either within the U.S. or outside of the U.S., may require advance export authorization by the appropriate U.S. Government agency prior to export or transfer. In addition, technical data may not be exported or transferred to certain countries or specified designated nationals identified by U.S. embargo controls without prior export authorization. By accepting this email and any attachments, all recipients confirm that they understand and will comply with all applicable ITAR, EAR and embargo compliance requirements.
participants (4)
-
Gergely Nagy
-
Patrick H.
-
vijay
-
Worsham, Michael