unix nohup logs are filled with 0 bytes [closed]

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
0
down vote

favorite












I am running the monitoring scripts in the background. They are supposed to all day (24x7).



In the script, based on the monitor output I have a function to start a process using nohup, redirecting the output to the log file /home/nohub_logs/logfile.txt.



The script works fine for few hours but after these few hours the log file is still zero bytes length. Sometimes if I kill the monitoring script and restart the script I get some output.



nohup startprocessscript.sh >> /home/nohuplog &


Logs are getting generated after some time. For example, if the script is running for the first 24 hours, then after 24 hours the logs are not getting created. If we restart the script the logs are created.



I am not sure why sometime the nohup log files are not getting any generated data. Can anyone help me, please.







share|improve this question














closed as unclear what you're asking by Ipor Sircer, Stephen Rauch, Jeff Schaller, Satō Katsura, DarkHeart Nov 1 '17 at 1:13


Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.














  • It seems that some logs are created and updated fine, while some are not. Can you elaborate on that?
    – Zip
    Oct 30 '17 at 13:47










  • nohup startprocessscript.sh >> /home/nohuplog & this is the command I am using logs are getting generated after some times say script is working for first 24 hours .. after 24 hours the logs are not getting created. if we restart the script the logs are created.
    – Hari Kris
    Oct 30 '17 at 14:01










  • You wrote "filled with 0 bytes", but you really mean that the output files stays empty (at size zero)?
    – dhag
    Oct 30 '17 at 15:45














up vote
0
down vote

favorite












I am running the monitoring scripts in the background. They are supposed to all day (24x7).



In the script, based on the monitor output I have a function to start a process using nohup, redirecting the output to the log file /home/nohub_logs/logfile.txt.



The script works fine for few hours but after these few hours the log file is still zero bytes length. Sometimes if I kill the monitoring script and restart the script I get some output.



nohup startprocessscript.sh >> /home/nohuplog &


Logs are getting generated after some time. For example, if the script is running for the first 24 hours, then after 24 hours the logs are not getting created. If we restart the script the logs are created.



I am not sure why sometime the nohup log files are not getting any generated data. Can anyone help me, please.







share|improve this question














closed as unclear what you're asking by Ipor Sircer, Stephen Rauch, Jeff Schaller, Satō Katsura, DarkHeart Nov 1 '17 at 1:13


Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.














  • It seems that some logs are created and updated fine, while some are not. Can you elaborate on that?
    – Zip
    Oct 30 '17 at 13:47










  • nohup startprocessscript.sh >> /home/nohuplog & this is the command I am using logs are getting generated after some times say script is working for first 24 hours .. after 24 hours the logs are not getting created. if we restart the script the logs are created.
    – Hari Kris
    Oct 30 '17 at 14:01










  • You wrote "filled with 0 bytes", but you really mean that the output files stays empty (at size zero)?
    – dhag
    Oct 30 '17 at 15:45












up vote
0
down vote

favorite









up vote
0
down vote

favorite











I am running the monitoring scripts in the background. They are supposed to all day (24x7).



In the script, based on the monitor output I have a function to start a process using nohup, redirecting the output to the log file /home/nohub_logs/logfile.txt.



The script works fine for few hours but after these few hours the log file is still zero bytes length. Sometimes if I kill the monitoring script and restart the script I get some output.



nohup startprocessscript.sh >> /home/nohuplog &


Logs are getting generated after some time. For example, if the script is running for the first 24 hours, then after 24 hours the logs are not getting created. If we restart the script the logs are created.



I am not sure why sometime the nohup log files are not getting any generated data. Can anyone help me, please.







share|improve this question














I am running the monitoring scripts in the background. They are supposed to all day (24x7).



In the script, based on the monitor output I have a function to start a process using nohup, redirecting the output to the log file /home/nohub_logs/logfile.txt.



The script works fine for few hours but after these few hours the log file is still zero bytes length. Sometimes if I kill the monitoring script and restart the script I get some output.



nohup startprocessscript.sh >> /home/nohuplog &


Logs are getting generated after some time. For example, if the script is running for the first 24 hours, then after 24 hours the logs are not getting created. If we restart the script the logs are created.



I am not sure why sometime the nohup log files are not getting any generated data. Can anyone help me, please.









share|improve this question













share|improve this question




share|improve this question








edited Oct 30 '17 at 14:54









roaima

40k546109




40k546109










asked Oct 30 '17 at 13:28









Hari Kris

11




11




closed as unclear what you're asking by Ipor Sircer, Stephen Rauch, Jeff Schaller, Satō Katsura, DarkHeart Nov 1 '17 at 1:13


Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.






closed as unclear what you're asking by Ipor Sircer, Stephen Rauch, Jeff Schaller, Satō Katsura, DarkHeart Nov 1 '17 at 1:13


Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.













  • It seems that some logs are created and updated fine, while some are not. Can you elaborate on that?
    – Zip
    Oct 30 '17 at 13:47










  • nohup startprocessscript.sh >> /home/nohuplog & this is the command I am using logs are getting generated after some times say script is working for first 24 hours .. after 24 hours the logs are not getting created. if we restart the script the logs are created.
    – Hari Kris
    Oct 30 '17 at 14:01










  • You wrote "filled with 0 bytes", but you really mean that the output files stays empty (at size zero)?
    – dhag
    Oct 30 '17 at 15:45
















  • It seems that some logs are created and updated fine, while some are not. Can you elaborate on that?
    – Zip
    Oct 30 '17 at 13:47










  • nohup startprocessscript.sh >> /home/nohuplog & this is the command I am using logs are getting generated after some times say script is working for first 24 hours .. after 24 hours the logs are not getting created. if we restart the script the logs are created.
    – Hari Kris
    Oct 30 '17 at 14:01










  • You wrote "filled with 0 bytes", but you really mean that the output files stays empty (at size zero)?
    – dhag
    Oct 30 '17 at 15:45















It seems that some logs are created and updated fine, while some are not. Can you elaborate on that?
– Zip
Oct 30 '17 at 13:47




It seems that some logs are created and updated fine, while some are not. Can you elaborate on that?
– Zip
Oct 30 '17 at 13:47












nohup startprocessscript.sh >> /home/nohuplog & this is the command I am using logs are getting generated after some times say script is working for first 24 hours .. after 24 hours the logs are not getting created. if we restart the script the logs are created.
– Hari Kris
Oct 30 '17 at 14:01




nohup startprocessscript.sh >> /home/nohuplog & this is the command I am using logs are getting generated after some times say script is working for first 24 hours .. after 24 hours the logs are not getting created. if we restart the script the logs are created.
– Hari Kris
Oct 30 '17 at 14:01












You wrote "filled with 0 bytes", but you really mean that the output files stays empty (at size zero)?
– dhag
Oct 30 '17 at 15:45




You wrote "filled with 0 bytes", but you really mean that the output files stays empty (at size zero)?
– dhag
Oct 30 '17 at 15:45










1 Answer
1






active

oldest

votes

















up vote
2
down vote













A common reason for this issue is output buffering.



Your script output might be flushed to the log file only after enough data has been written.



Possible workarounds are stdbuf and unbuffer see Turn off buffering in pipe






share|improve this answer



























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    2
    down vote













    A common reason for this issue is output buffering.



    Your script output might be flushed to the log file only after enough data has been written.



    Possible workarounds are stdbuf and unbuffer see Turn off buffering in pipe






    share|improve this answer
























      up vote
      2
      down vote













      A common reason for this issue is output buffering.



      Your script output might be flushed to the log file only after enough data has been written.



      Possible workarounds are stdbuf and unbuffer see Turn off buffering in pipe






      share|improve this answer






















        up vote
        2
        down vote










        up vote
        2
        down vote









        A common reason for this issue is output buffering.



        Your script output might be flushed to the log file only after enough data has been written.



        Possible workarounds are stdbuf and unbuffer see Turn off buffering in pipe






        share|improve this answer












        A common reason for this issue is output buffering.



        Your script output might be flushed to the log file only after enough data has been written.



        Possible workarounds are stdbuf and unbuffer see Turn off buffering in pipe







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Oct 30 '17 at 14:48









        jlliagre

        45k578124




        45k578124












            Popular posts from this blog

            Peggy Mitchell

            The Forum (Inglewood, California)

            Palaiologos