Bash: How to flush output to a file while running
Posted
by noam
on Stack Overflow
See other posts from Stack Overflow
or by noam
Published on 2009-09-15T22:26:18Z
Indexed on
2010/05/29
20:52 UTC
Read the original article
Hit count: 281
I have a small script, which is called daily by crontab using the following command:
/homedir/MyScript &> some_log.log
The problem with this method is that some_log.log is only created after MyScript finishes. I would like to flush the output of the program into the file while it's running so I could do things like
tail -f some_log.log
and keep track of the progress, etc.
© Stack Overflow or respective owner