Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have an application that prints errors on stderr. I can redirect that output to a file with

app 2> log.txt

(Un)fortunately I log tons of information. I'd like log.txt to not grow too much, or it will break my tiny ramdisk. Is there any way to have some kind of rotating log like this?

In my ideal scenario, log.txt will always be of 100kb size, containing latest output only.

I know that POSIX systems are all pipes and filters and I figured that it is something a lot of people would want to do so is there some way to do this with basic linux commands? I say basic because I can't really rely on packages since I'm on an arm9 system and cross compiling is sometimes difficult.

On a sidenote, I don't have cron on my system =(

share|improve this question

Get yourself one or more of:

None of them requires cron; none requires syslog or anything more than ordinary pipes; and all do exactly what you want to do: turning standard input into a set of automatically rotated and size limited log files.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .