Windows batch logrotate


















Embed What would you like to do? Embed Embed this gist in your website. Share Copy sharable link for this gist. Learn more about clone URLs. Download ZIP. This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Logrotate GPL. Source code for logrotate. Source code for Cygwin.

Itefix free software license Simplified BSD. Generate some random strings and GUIDs. Copssh usage. Nagwin usage. Itefix Labs - demo.

SHA hash. It only takes a minute to sign up. Connect and share knowledge within a single location that is structured and easy to search. We have a huge logfile being written by a vendor's application. Let's assume the vendor won't do anything that we ask. Is there any way of rotating that logfile? We're looking at about MB an hour being written - I'd much rather chunk that into 10 MB pieces, and let anything older than a day or over files fall off a cliff.

I know I know, possible duplicate of How do you rotate apache logs on windows without interrupting service? Aha - the Chomp log was dead, but searching for "chomp logrotate" brought me to its new site. I'll give it a try tomorrow and reply if I like it. I'd still like to hear about software anyone else is using that works for this. As much as I wince at the suggestion, installing Cygwin is one of the very few options that you have available to you.

From there, you can use logrotate. I haven't used it yet, but LogRotateWin is a native implementation of logrotate for Windows that looks promising. At least it doesn't require Cygwin. Have a look at logwot8 , which is a packaging of logrotate, a limited shell environment and required cygwin layer components ready to work out of the box 4 MB installer size. You need to customize configuration file according to your reqiurements.

It is free for use and distribution under 2-sentence BSD license. I've tried LogRotateWin over the last few days. The projects seems somewhat abandoned and I've found a few bugs in just the little testing I've done. Not just when their time has come. So you can only use absolute paths. But the exe is just 40KB and it does have a few nice features. And I like that fact their mission statement is "The goal is to use the same command line parameters and files as the Linux version.

Something of a meta-problem: how do you log the activities of logrotate itself? Asked 6 years, 11 months ago. Active 6 years, 11 months ago. Viewed 2k times. Improve this question. Misu Egri Misu Egri 43 1 1 silver badge 9 9 bronze badges. Add a comment. Active Oldest Votes. Improve this answer. Dmitry Sokolov Dmitry Sokolov 2, 1 1 gold badge 26 26 silver badges 31 31 bronze badges.



0コメント

  • 1000 / 1000