#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2013
    Posts
    4
    Rep Power
    0

    How can get the run display message in time...?


    We had a procedure run on solaris, it has some message continue display on the CONSOLE, I want get message for analyse, So I use the '|' and Tee, like: proc1 2>&1 |tee \tmp\mylog.txt. Now the message still display on the CONSOLE, But the mylog.txt not be wirte in time. It only write every 5120Byte, that is not I want.

    How can i get the run message in time??

    Thank for every look this post.....
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Mar 2006
    Posts
    2,394
    Rep Power
    1688
    Try tee -a \tmp\mylog.txt (the -a will make the tee command append to the file)
    The moon on the one hand, the dawn on the other:
    The moon is my sister, the dawn is my brother.
    The moon on my left and the dawn on my right.
    My brother, good morning: my sister, good night.
    -- Hilaire Belloc
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2013
    Posts
    4
    Rep Power
    0
    Originally Posted by SimonJM
    Try tee -a \tmp\mylog.txt (the -a will make the tee command append to the file)
    Yes, I had try -a to append file, But It still write file after waiting for every 5120 Byte...

    I want It write to mylog.txt every display line at Console.....
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Mar 2006
    Posts
    2,394
    Rep Power
    1688
    Unsure as to why it is not populating the file at the same time as the output to the screen - possibly a buffering issue within the filesystem?
    The moon on the one hand, the dawn on the other:
    The moon is my sister, the dawn is my brother.
    The moon on my left and the dawn on my right.
    My brother, good morning: my sister, good night.
    -- Hilaire Belloc
  8. #5
  9. Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Sep 2006
    Posts
    834
    Rep Power
    387

    Cool


    Originally Posted by gzm001
    We had a procedure run on solaris, it has some message continue display on the CONSOLE, I want get message for analyse, So I use the '|' and Tee, like: proc1 2>&1 |tee \tmp\mylog.txt. Now the message still display on the CONSOLE, But the mylog.txt not be wirte in time. It only write every 5120Byte, that is not I want.

    How can i get the run message in time??

    Thank for every look this post.....
    Have you tried this?:
    Code:
    proc1 >/tmp/mylog.txt 2>&1
    This is winDoze notation: "\tmp\mylog.txt"
  10. #6
  11. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2013
    Posts
    4
    Rep Power
    0
    Yes, I had try the > before use the 'tee' command.... but result was same, And I can sure the message was display at Console in time....

    Now , I think ,
    May be need to modify someone config of system .....
  12. #7
  13. No Profile Picture
    Contributing User
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Mar 2006
    Posts
    2,394
    Rep Power
    1688
    How are you checking the content of the file you are tee-ing the output into?
    The moon on the one hand, the dawn on the other:
    The moon is my sister, the dawn is my brother.
    The moon on my left and the dawn on my right.
    My brother, good morning: my sister, good night.
    -- Hilaire Belloc
  14. #8
  15. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2013
    Posts
    4
    Rep Power
    0
    Originally Posted by SimonJM
    How are you checking the content of the file you are tee-ing the output into?
    every once in a while( Maybe 10 minute, or 30 minute )tee wrote 5120 byte into log file, Then can cat the log file.....

    But, That not I want ....
  16. #9
  17. No Profile Picture
    Contributing User
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Mar 2006
    Posts
    2,394
    Rep Power
    1688
    To start with, just to be sure you are getting what should be happening, I'd be inclined, in another terminal session to do a tail -f on the out put file and then watch both the console and the tail at the same time to be sure that they are in sync.
    The moon on the one hand, the dawn on the other:
    The moon is my sister, the dawn is my brother.
    The moon on my left and the dawn on my right.
    My brother, good morning: my sister, good night.
    -- Hilaire Belloc

IMN logo majestic logo threadwatch logo seochat tools logo