Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

change the naming convention of the output file

Status
Not open for further replies.

abdulaix

Technical User
Aug 2, 2008
1
IN
Hi

Currently we have nmon running on our Red hat Linux server.
The ouput file is now coming with the naming convention as "servername_160321_0010.nmon".

The output file naming convention has to be changed as "nmon_servername_daily_2016.03.21_00.00.00"

How can we do it ? Any suggestions please ?

Below is the nmon script scheduled in cron.

[root@servername nmonlog]# crontab -l | grep -i nmon
10 00 * * * /usr/bin/nmon_x86 -ft -s 60 -c 1440 -m /vol/nmonlog > /dev/null 2>&1

Below is the location where the output files are saved :

[root@servername nmonlog]# pwd
/vol/nmonlog

[root@servername nmonlog]# ls -ltr | grep -i nmon
-rw-r--r-- 1 root root 3820143 Mar 11 00:09 servername_160310_0010.nmon

I can't open the file using

# cat /usr/bin/nmon_x86

in putty as it is a binary file.

So the file comes as hostname_YYMMDD_HHMM.nmon.
After the file is generated and completed for a particular day, can we rename the file from "hostname_YYMMDD_HHMM.nmon" to
"nmon_servername_daily_2016.03.21_00.00.00". Say for example if the data is collected for March 21st, I believe when the day March 21st ends at 23:59 nmon creates a new file for March 22nd. So after the data collection started for March 22nd a script has to be put to rename the file for March 21st. Is there an option to schedule this on crontab so that the file gets renamed automatically everyday.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top