Skip to content
Advertisement

Linux IO operator ‘>’

I have cronjob as jstack > error.log every second to get the snapshot of error.

My problem is if I use > operator in linux does it close file also or keep the file open?

Advertisement

Answer

Whats the problem, look for open files in system and check if the file is still open, lsof | grep <your filename>. You will get the answer.

Though it would be closed, just to be sure you can do that.

NOTE: I am sure if you are running it every sec, it wont run every sec.. Cron daemon comes to see cronjob every minute by default. So its too much to ask from cron.

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement