Tuesday, October 8, 2013

Saving output of shellscript to log file

www.unixbabuforum.ini want to save output of shell script to a log file. 
I have a shell scipt which defraggs different filesystems. 
I want to save its output to a file. 
I want to keep a note of all filesystems defragged
www.unixbabuforum.inone suggestion is to add something to the script. I am assuming you are 
listing the filesystems and using that list to create variables. Add 
>> /path/logfilename at the end of the defrag command. If you are 
specifying the filesystems then add the same at the end of each defrag 
command. The > redirects output to the specified file and >> appends 
redirected output to the same log file. Just one possible idea and there 
may be others


Post a Comment

Design by BABU | Dedicated to grandfather | welcome to BABU-UNIX-FORUM