The same technique with a different command: the old report lines stay, and the error messages go to a file of their own.
Once a week the size of /var/log is added to the report, to see how fast the logs grow. du with the -sh options prints how much space a directory takes, such as 17M /var/log. Directories that student may not look into, du skips, reporting each one to the error stream. This time, put the commands together yourself.
Add to the report without losing lines
~/stream-lab/report.log has two lines — the size of /var/log in past weeks. Add a third with today's size, which du -sh /var/log prints. The old lines must stay, and du's error messages must end up in errors.log.
Goals · 0 of 2
- Add today's size, keeping the old lines not done yet
- Collect du's error messages in errors.log not done yet