Truncating a file while it's being used (Linux)

后端 未结 13 2145
名媛妹妹
名媛妹妹 2020-12-05 01:54

I have a process that\'s writing a lot of data to stdout, which I\'m redirecting to a log file. I\'d like to limit the size of the file by occasionally copying the current

13条回答
  •  庸人自扰
    2020-12-05 02:36

    instead of redirecting it to a file you could pipe it to a program that automatically rotates the file by closing it, moving it and opening a new one every time it gets too big.

提交回复
热议问题