I found over a gigabyte of files in var/log/bootchart. I don't want any but the most recent file to be saved. Can this be done?
You could probably set a cron script to do that.
I assume (in this answer) the files are named
bootchart.log.1 and so on.
crontab -e as the root user, select your editor and add into the end of the file:
@reboot /bin/sleep 60 && /bin/rm /var/log/bootchart/bootchart.log.*
Let's break it down
@reboot Tells cron to run on reboot.
/bin/sleep The command CRON runs. This is the x of the
60 The delay for
sleep, in seconds.
&& Fancy Linux for "do y after x is done" as in
x && y
/bin/rm The y of the
&& statement. It is the "delete" command of Linux.
/var/log/bootchart/bootchart.log.* The file to delete for
rm. It says "delete all files beginning with
bootchart.log. (note the dot at the end) in the folder
bootchart.log.*, a file named
bootchart.log.chicken will be deleted, but
bootchart.log itself will not.