Change the naming convention of the output file


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Change the naming convention of the output file
# 8  
Old 04-18-2016
Do you see a chance to schedule an adaption of this at midnight?
# 9  
Old 04-18-2016
Hi RudiC

Thanks for your reply.

If I want to run the cronjob at 12:15 everyday, will the below do the work for me :

Code:
15 12 * * * /bin/mv /vol/nmonlog/servername_160416_0010.nmon /vol/nmonlog/nmon_servername_daily_2016.04.16_00.00.00

But how to make sure that the renaming of the file happens everyday ?

Moderator's Comments:
Mod Comment Please use code tags as required by forum rules!

Last edited by RudiC; 04-18-2016 at 04:33 AM.. Reason: Added code tags
# 10  
Old 04-18-2016
Did you consider and understand the proposal in post#8?

Above will work exactly ONCE unless /vol/nmonlog/servername_160416_0010.nmon is recreated regularly.
# 11  
Old 04-18-2016
name convention change

Hi RudiC

Thanks for your reply.

To be frank I did not understand the proposal in post#8 since I'm just trained in AIX and new to scripts.

In the below crontab you can see that the sourcefile is of the format like servername_YYDDMM_00**.nmon

Also the destination file is of the format nmon_servername_daily_YYYY.MM.DD_00.00.00
Code:
15 12 * * * /bin/mv /vol/nmonlog/servername_160417_0010.nmon /vol/nmonlog/nmon_servername_daily_2016.04.17_00.00.00

I'm not sure how I can use the proposal in post#8 to this issue because I'm not aware of what is [0-9]* and FN.

Can you please advise me.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Naming output files based on variable parameters and input filenames

Hello, I have a series of files in sub-directories that I want to loop through, process and name according to the input filename and the various parameters I'm using to process the files. I have a number of each, for example file names like AG005574, AG004788, AG003854 and parameter values like... (2 Replies)
Discussion started by: bdeads
2 Replies

2. Red Hat

File System Naming Convention

Hi, I am installing a new RHEL 5 application server containing JBOSS along with other specific 3rd party applications. I know that this usually gets installed in /opt but I was thinking of installing these on a new separtate lv / file system instead. i.e. /<my_new_FS_name> rather than... (6 Replies)
Discussion started by: Duffs22
6 Replies

3. UNIX for Dummies Questions & Answers

Check file name against convention

I need this script to check if the first 3 letters of the file name are capital. find . -type f -name *001.dpx -exec find {} ! -name ???_???_???_v??.??????.dpx \; >> ./Bad_FileNames.txt Currently it finds the first frame of the sequence and tests that against the naming convention. It works... (6 Replies)
Discussion started by: scribling
6 Replies

4. Fedora

Basic question regarding rpm naming convention.

Hi Guys, Where would i find the list of distribution codes. For example. samba-32bit-3.4.2 -1.1.3.1.x8664.rpm In above rpm file it is indicated that its release is 1.1.3.1 . The rpm is meant to be run for opensuse. Where would i get the linking of release number and distribution. ... (2 Replies)
Discussion started by: pinga123
2 Replies

5. Shell Programming and Scripting

Concatenate files to one file with naming convention

Hi , i have below files in wrk folder. file names are 1102090001.CLT 1102090003.CLT 1102100019.CLT 1102100020.CLT the above files are concatenate to one file but that concatenate file name must be same naming convention. (date +%y%m%d)and 0001 count. example : concatenate file... (9 Replies)
Discussion started by: krbala1985
9 Replies

6. Hardware

Motherboards naming convention

For the selection of motherboards, is there any naming convention in the type numbers? There is usually a brand name and sometimes a version name, but more essential details like form factor, SATA speed and maximum amount of RAM is never given. Is there a reason for that? Is there any background... (2 Replies)
Discussion started by: figaro
2 Replies

7. Shell Programming and Scripting

Naming convention script

OK, so a quick background: I am a sys admin for a 1:1 deployment in academia with Macbooks, totaling around 6,000. Macbooks get shifted around from building to building and go to and from the repair center if hardware repair is needed. Often, some machines will get moved from one building to... (8 Replies)
Discussion started by: tlarkin
8 Replies

8. Shell Programming and Scripting

Change file output format

I have a file which has following contents usmtnz-dinfsi19 62 61 18400 18800 99.7 usmtnz-dinfsi19 62 61 18400 18800 99.7 i want the o/p to be like date (7 Replies)
Discussion started by: fugitive
7 Replies

9. Emergency UNIX and Linux Support

Read file and change a 0 to a 1 in output

<key>ExcludeSimpleHostnames</key> <integer>0</integer> <key>FTPPassive</key> Need simple command that will change the 0 to a 1 in this file when I grep it, but only for this integer key directly after the ExcludeSimpleHostnames key. I got this output code... (8 Replies)
Discussion started by: glev2005
8 Replies

10. UNIX Desktop Questions & Answers

Naming convention for Libraries..

Hi All, I need to know standard naming convention for Unix libraries (including all flavours of unix)..As I have gone through some sites and found out The UNIX convention for naming of libraries is lib<name>.so.<major>.<minor>.<revision> so is it statndard . also does it change... (0 Replies)
Discussion started by: rkshukla14
0 Replies
Login or Register to Ask a Question