Saving output with the EXT3 logsave utility


I was doing some console work this week, and needed a way to save the output from several commands to a file. File redirection and the script utility would have worked, but I decided to use the logsave utility instead:

$ logsave foo /bin/ls /bin/lsblk /bin/lsmod

anaconda-ks.cfg
apache
foo
install.log
install.log.syslog

$ </strong>more foo</strong>

Log of /bin/ls
Sun Jan 14 08:59:45 2007

anaconda-ks.cfg
apache
foo
install.log
install.log.syslog

Sun Jan 14 08:59:45 2007
----------------

I like the fact that logsave writes one timestamp before the output is written to the file, and a second timestamp once the write operation completes. If you ever need to time something, this is one way to do it (time and timex also work, but they don’t include the output).

This article was posted by Matty on 2007-01-15 20:18:00 -0400 -0400