Sponsored Content
Top Forums Shell Programming and Scripting Extract section of file based on word in section Post 302454752 by bartus11 on Monday 20th of September 2010 02:16:10 AM
Old 09-20-2010
If you don't need the "Normal backup" line then this can do:
Code:
virtualMachines="IIBSBS IIBVICDMS01 IIBVICMA01"
for i in ${virtualMachines}; do awk "/$i/,/Duration/" /tmp/backup.log > vdrlog-$i; done

In case that this line is important for you, let me know I'll come up with some Perl.
This User Gave Thanks to bartus11 For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

sed & awk--get section of file based 2 params

I need to get a section of a file based on 2 params. I want the part of the file between param 1 & 2. I have tried a bunch of ways and just can't seem to get it right. Can someone please help me out.....its much appreciated. Here is what I have found that looks like what I want....but doesn't... (12 Replies)
Discussion started by: Andy Cook
12 Replies

2. UNIX for Dummies Questions & Answers

how can i extract text section via grep

hi, i have a very long text file. i need to extract with grep command a certain part. for example text file include 1ooo rows: 1.... 2... 3... . . . 1000 i want to view with grep only rows 50-100. any ideas will be appreciated thanks... (8 Replies)
Discussion started by: meny
8 Replies

3. Shell Programming and Scripting

Search and extract by section from configuration

Hi, I understand either AWK or SED can do this, but I not sure how to extract the following configuration in section. Meaning when I need to find code with " ip helper-address 192.168.11.2" , it would start from "interface Serial0/0" and "interface FastEthernet0/1". Only displaying both section... (2 Replies)
Discussion started by: haphazard
2 Replies

4. Shell Programming and Scripting

Selecting A Section of A File Based On the Time Within It

Hi, I have a file formated like this: John 7.22 2010-01-25_17:01:36 George 8.22 2010-01-25_17:02:36 Bob 9.62 2010-01-25_17:04:36 Jane 10.11 2010-01-25_17:05:36 Emma 4.52 2010-01-25_17:01:36 What I want to do is cut out only the entries that have... (2 Replies)
Discussion started by: Donkey25
2 Replies

5. Shell Programming and Scripting

Format output from the file to extract "date" section

Hello Team , I have to extract date section from the below file output. The output of the file is as shown below. I have to extract the "" this section from the above output of the file. can anyone please let me know how can we acheive this? (4 Replies)
Discussion started by: coolguyamy
4 Replies

6. Shell Programming and Scripting

Deleting a section based on search from other file

Hi Everyone, I need some help to accomplish the below. help is highly appriciated. I have a 45 mb file with ldap entries. Each user entry is separated by a string # entry-id: 1 and so on. Some of the entries has a string xyz: true. I want to delete the section if the user section has xyz: true... (6 Replies)
Discussion started by: Samingla
6 Replies

7. Shell Programming and Scripting

Prepend first line of section to each line until the next section header

I have searched in a variety of ways in a variety of places but have come up empty. I would like to prepend a portion of a section header to each following line until the next section header. I have been using sed for most things up until now but I'd go for a solution in just about anything--... (7 Replies)
Discussion started by: pagrus
7 Replies

8. Shell Programming and Scripting

Fetch a section from a file

Hi, I have a file like... $cat file1 +++++++++++++++++++ client1 +++++++++++++++++++++++++++++ col1 col2 col3 ------ ----- ----- (0 rows affected) ========================================================= +++++++++++++++++++ client1 +++++++++++++++++++++++++++++ col1 col2 col3... (6 Replies)
Discussion started by: sam05121988
6 Replies

9. Shell Programming and Scripting

Extract record from file based on section.

input file output file (1 Reply)
Discussion started by: lathigara
1 Replies

10. Shell Programming and Scripting

Copying section of file based on search criteria

Hi Guru's, I am new to unix scripting. I have a huge file with user details in it(file2) and I have another file with a list of users(file1). Script has to search a user from file1 and get all the associated lines from file2. Example: fiel1: cn=abc cn=DEF cn=xyx File 2: dn:... (10 Replies)
Discussion started by: Samingla
10 Replies
dgcfgbackup(1M) 														   dgcfgbackup(1M)

NAME
dgcfgbackup - create or update VxVM volume group configuration backup file SYNOPSIS
/usr/sbin/dgcfgbackup [-f dg_conf_path ] dg_name DESCRIPTION
The dgcfgbackup command saves the VxVM configuration for a disk group in a default or alternate configuration backup file (see the descrip- tion of the-f option). By default, dgcfgbackup is run automatically each time that a VxVM command changes the VxVM configuration. In this case, it always uses the default configuration backup file. An existing default configuration backup file is renamed with an extension of .old. Options and Arguments dg_name Specifies the name of a disk group. -f dg_conf_path Saves the configuration using an alternate file name specified by dg_conf_path. If this option is omitted, the default file name is /etc/vxvmconf/dg_name.conf. EXIT CODES
dgcfgbackup exits with a zero status on successful completion. An non-zero exit status indicates that errors occurred when information from the disk group was being accessed. EXAMPLES
Back up VxVM configuration information for disk group testdg in the default backup file /etc/vxvmconf/testdg.conf: dgcfgbackup testdg Back up VxVM configuration information for disk group datadg in the alternate configuration backup file /tmp/datadg.backup: dgcfgbackup -f /tmp/datadg.backup datadg NOTES
It is recommended that any alternate configuration backup file be created in the root file system (as is the case with the default path name). This facilitates disk group recovery during maintenance mode, such as after a system crash. AUTHOR
dgcfgbackup was developed by the Hewlett-Packard Company. SEE ALSO
dgcfgrestore(1M) VxVM 5.0.31.1 24 Mar 2008 dgcfgbackup(1M)
All times are GMT -4. The time now is 04:23 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy