Results 1 to 3 of 3
So I want to watch processes as they finish executing and the data gets logged in process accounting. I run the latest version of fedora.
I tried this:
Code:
tail ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 03-06-2012 #1Just Joined!
- Join Date
- Aug 2010
- Posts
- 10
tailing /var/account/pacct?
So I want to watch processes as they finish executing and the data gets logged in process accounting. I run the latest version of fedora.
I tried this:
However it didn't work. It just sat there doing nothing. So I though maybe /var/account/pacct wasn't being written to at the end of execution. I checked the filesize as I executed files. I ran lastcomm -f /var/accout/pacct to make sure the new commands were showing up and everything was working.Code:tail -f -c 0 /var/account/pacct | lastcomm -f -
I took it a step further and tried just doing this:
Sure enough, tail was refusing to feed out the data. I though it might be an EOF issue, so I tried -F instead.Code:tail -f -c 0 /var/account/acct
Anyone have any ideas how to make this happen? I assume it might be because the file is binary data, but there has to be a way around it.
- 03-06-2012 #2
Have your tried;
-c 0 is telling tail to output 0 bytes.Code:tail -F /var/account/acct
-c, --bytes=N
output the last N bytes
- 03-06-2012 #3Just Joined!
- Join Date
- Aug 2010
- Posts
- 10
The `-c 0` part is fine. I am attempting to only output new data that is added to the file. If I returned any previous data, it could be partial data causing lastcomm to freak out. After some further reading, it seems that GNU tail isn't very good at supporting binary data in itself. Also piping any binary data to lastcomm is going to be a fruitless endevour as well, because it seems to throw the data in based on line breaks, where the pacct binary data has none. I'm probably going to have to write a perl script to read data as it is added to the file and do exactly what lastcomm does.


Reply With Quote
