Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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
add comment

1 Answer

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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.