02-18-2014 07:01 AM
Would like to share you an idea, hope this would be helpful to you...
While checking System.txt file on windows nodes thru ovpdeploy, it would be better if we had a tail command similar to unix/linux. but windows never provide the unix/linux equivalent of tail command.
Any ideas on this - tail command equivalent on windows?!?!
02-18-2014 07:05 AM
Hope the below link would help you ..
Tell me and I forget. Teach me and I remember. Involve me and I learn. -- Benjamin Franklin
02-18-2014 07:15 AM
I was looking for direct steps (without installing any new tools) for quite sometime and all google searches didnt yield good results, including stockoverflow.. (i used to think that no questions will go out of stockoverflow unanswered ;) ) but that Stockoverflow post gave me some tips. a vb script idea. but i found my own idea instead of that vb script.
1. Find out the number of lines on a required logfile using windows find command.
find /c /v "" System.txt will give us the total number of lines on the given file.
MGMT_SVR# ovdeploy -cmd 'find /c /v "" "C:\Program Files\HP OpenView\data\log\System.txt"' -host <managed-node>
---------- C:\PROGRAM FILES\HP OPENVIEW\DATA\LOG\SYSTEM.TXT: 1539
2. Windows "more" command gives an idea "more +f System.txt" --- will be equivalent of tail -f System.txt
since that system.txt file got 1539 lines, i want to see last 100 lines only:
MGMT_SVR# ovdeploy -cmd 'more +1439 "C:\Program Files\HP OpenView\data\log\System.txt"' -host <managed-node>
Hope you like this one.. please let me know if arent. we will delete this post ;)
have a great day!!
02-18-2014 07:26 AM
You can also use powershell example:
Hope this information helps.
Thanks and Regards,
If you find that this or any post resolves your issue, please be sure to mark it as an accepted solution.
If you liked it I would appreciate KUDOs.