tags:

views:

14

answers:

1

Will nohup.out consume space / make the server slow if a shell is allowed to run in infinite loop in server using the command: "nohup ./shell & > nohup.out"

I had written a small program in shell script that will run in infinite loop, (since I don't have privilege to add my script in crontab) and the output of the same is of 4 lines which is to be thrown into nohup.out after every 4 hours. Now my question is if the program keeps running in background with help of nohup command as I typed earlier then will the nohup.out file size keep increasing into a huge size with time and if in that case it would affect server by making it slow or something. Or will the nohup.out file constantly get archived for the old data and the size will get restricted on its own.

Thanks, to the viewer of my question and to the person who will guide me in this scenario.

A: 

I think you need some tool like logrotate, to archive the file on a time basis and to limit the number of archives mantained.

enzotib
Thanks enzotib for your prompt answer. I'll try it out.
mohona
Err, logrotate is normally installed as a cron job. Note OP claims not to have access to crontab. However, OP: you do know you don't have to have special privileges to use (private, not root-level) crontab - if neither a whitelist nor a blacklist exist, it is free for all; so if the administrator did not go out of his way to block users, you might be able to use it.
Amadan
crontab -e and the person can use a user-level cron job, no need for root
Mike Axiak
This do not imply the user cannot use it in an infinite loop he already do with the script itself.
enzotib
@Mike: Yeah, sorry for the ninja edit, I saw your response too late :)
Amadan