I have a script running every minute on cron and want to output the script output to terminal as well as to a log file. I think I use tee -a for this.
Right now the python script just prints the current time.
* * * * * python script.py | tee -a script_times.log
The above logs to the file but not to stdout.
I thought tee outputs to stdout and to any given file.
How can I make it log out as well as log to file?
If you're looking to write output to a specific terminal, you'd need to redirect it there, for example,
* * * * * python script.py | tee -a script_times.log > /dev/pts/0. Replace/dev/pts/0with your terminal's device file, typically found using thettycommand