Quote:
Originally Posted by
RudiC
Your two outputs show totally different columns. I doubt they are created by the same, identical script, once run interactively, and once by cron
I am not familiar with sar, but the observed discrepancy can be the result of a single missing field (field 2, the AM/PM field) shifting subsequent fields by -1.
The fields printed are 1, 2, 4, 6, 7. If the only difference is that the incorrect result's input is missing the AM/PM field, then its output translates to fields 1, 3, 5, 7, and 8 from the correct input. We don't know what 3, 5, and 8 look like. We do know that field 7 is iowait and it is shifted to the left by one as expected.
Again, I am not familiar with sar. I don't know what's going on. I'm just pointing out that this could be the result of column 2 being absent.
Some tools use different default formats for root than they do for unprivileged users. Perhaps this is one of them? Is the cronjob privileged while the manual runs are not?
Regards,
Alister