Curbing output file.

Here you can discuss every aspect of Debian. Note: not for support requests!
Post Reply
Munty Scruntfundle
Posts: 54
Joined: 2018-11-27 16:53

Curbing output file.

#1 Post by Munty Scruntfundle »

Hi there.

I have a program I run on multiple nodes with a loop and an ssh command. I have this working and I can set the app off without any problems. At the moment I have to use nohup and send all output to /dev/null as there's a load of garbage.

The problem being I have no way of checking the state of the app. I would far sooner send the output to a file that I could check from time to time, but it will get huge. How would I curb the size of this file without the ability to change the original program?

I'm resigned to using a bash or python script which isn't too much of a problem, but I have no idea how I would open the 'data' file, remove the first xxx lines and save it again while the original program is still trying to write to it. I'd be surprised if this was possible. I don't know for sure what the error trapping is in the original program, I suspect it will just crash.

Can anyone think of a way to achieve this? I'm pretty stumped.

Many thanks.

Post Reply