Switch stdout between /dev/null and a file?
Hello,
I have a script which I run using nohup. When I run it it will (as expected) redirect the output to the file nohup. This is great because I can tail -f the file and see whats going on. I want to stop this file from filling my disk while I'm not logged in (but leave the script running) but still be able to tail -f it to see the output when I am logged in. Is there a way to switch the output from nohup between this file and /dev/null while it is running?
(or maybe use cron to truncate the file every now and then?).
Cheers,
Gremlin.
|