Problem with watch function
Hello,
I've never used Linux, but I have to use it for the thesis. I want to monitorate the performances of a multiprocessor node, the IT department told me to use: "watch --interval=1800 "pdsh -w comp[12,34,45] uptime"" but I want to save the information on a file, is it possible? I was even looking this http://linux.die.net/man/8/md-mx-ctrl. I am interested in the load of the nodes, since there are three nodes working. Thank you very much for the interest Regards Antonio |
Displays the output on the screen and logs the output to a file.
Code:
watch --interval=1800 "pdsh -w comp[12,34,45] uptime | tee -a logfile" |
Thank you very much!
|
you can do it like below also: -
watch --interval=1800 "pdsh -w comp[12,34,45] uptime >> log.txt. |
Thank you!
Just for understanding, the commands should write the output in the file as appending, isn't it? Because I tried the Quote:
Cheers Antonio |
the one I posted above will append the data into the file.
|
Quote:
|
sorry guys,
but it is not working. I want it to run even if linux is closed, but as long as I close the window created after I type the command, it doesn't update anymore the file. Is there a manner to make it working even if linux is closed? Thank you |
there one way where you can use it after shutting down your system..
By using crontab command you can update ...this command automatically updates your requirements. cmd is crontab -e(edit) <filename> press enter * * * * * watch --interval=1800 "pdsh -w comp[12,34,45] uptime >> log.txt. (minutes) (hour) (date of month) (month) (date of week) (task) The above command updates your requirement every day even after your system shutdown. |
Dear diteshwithu,
let's say that practically speaking linux is on, it's working, since I am sending some jobs to a computer for making calculations, but I calse the interface for speaking with linux. The command for updating the file each half an hour is: Quote:
where does crontab enters? Thank you |
the simplest way is use command with nohup: -
open the terminal run: - nohup watch --interval=1800 "pdsh -w comp[12,34,45] uptime >> log.txt& now even if you close your terminal the command will keep on running. |
Dear hanishmadan
are you sure of this command: Quote:
> and doesn't create any file Thank you |
why are you giving - before nohup... just use nohup and full command and & sign in the last
|
Dear hanishmadan,
probably I didn't give you all the information, anyway this is what I write and the output: http://yfrog.com/58nohgp Thanks Antonio |
Dear Mortain,
if you look at your command you are giving " at the begining of pdsh in your command, it has to be closed before you give redirection to the file or you finish the command .. so please verify your command once again and then run it. |
All times are GMT -5. The time now is 03:22 PM. |