codingfreak
codingfreak

Reputation: 4595

How to dump output into a file rather than on terminal

I am using an expect script to login into a machine via serial console and reboot the machine.

I can see all the logs on terminal. Is there a way these logs are moved into log file and only display FAILURE or SUCCESS ?

Thanks for your time

Upvotes: 1

Views: 249

Answers (1)

komar
komar

Reputation: 881

1.

# disable log output to stdout
log_user 0

# send/expect dialogue is logged to my.log
# The -a flag forces output to be logged
# that was supressed by the log_user command.
log_file -a my.log
  1. For output FAILURE or SUCCESS messages you need use send_user or send_tty

Upvotes: 2

Related Questions