I have got the following logging script:
#!/bin/bash top -b -c -n 1 >> /var/log/toplog/top.log
And the following record in my crontab:
*/1 * * * * /home/clime/scripts/toplog.sh
The problem is that lines in top.log are being cut to 80 chars, e.g.:
1512 root 20 0 80756 1436 572 S 0.0 0.1 0:05.92 /usr/libexec/postfi
This does not happen if I run the command directly from console.
I have tried to use COLUMNS variable:
*/1 * * * * COLUMNS=999 /home/clime/scripts/toplog.sh
But that leads to every line being long exactly 999 characters - unused space is padded with spaces, which is not what I want.
How to fix this strange issue? My system is centos 6.3.