Sponsored Content
Top Forums Shell Programming and Scripting Shell script to pull certain fields Post 302983152 by Don Cragun on Thursday 6th of October 2016 11:31:11 PM
Old 10-07-2016
In addition to what Chubler_XL has already said, if the dates to be used are based on the values in field #14 instead of being the dates on the 1st and last records in the file, you have to know the format of the date fields to determine how to perform the comparisons. And, if the values are to be extracted from the 1st and last data records in the file, we have to know if there are any header and/or trailer lines in the file.

This is why it is crucial that you give us a representative sample of the file(s) you will be processing.

Furthermore, you aren't at all clear about what tools are available for this project. You say the files you want to process are on a server. Will your script be run on that server while you are logged into that server? Will the files be located on one server while the script will be running on a different server?

The more details you hide from us, the less help we will be able to provide.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Can a shell script pull the first word (or nth word) off each line of a text file?

Greetings. I am struggling with a shell script to make my life simpler, with a number of practical ways in which it could be used. I want to take a standard text file, and pull the 'n'th word from each line such as the first word from a text file. I'm struggling to see how each line can be... (5 Replies)
Discussion started by: tricky
5 Replies

2. UNIX for Dummies Questions & Answers

Pull a file from a remote server through a shell script

Hi, I am writing a shell script to pull a file from a remote server (Let say its a windows based remote server). One of my criteria is to pull a file only if it is not empty. We have done a similar script to push a file from our end to a remote server and before pushing it we check for the... (2 Replies)
Discussion started by: sashankkrk
2 Replies

3. Shell Programming and Scripting

script to pull info from my email?

Hi, I need help writing a script that would pull info from an email inbox and add it to an Evolution Calendar. I'm pretty sure I can google the commands to add the info to the calendar. The part that I really need help with is getting the info from the email into the command. Basically for... (6 Replies)
Discussion started by: xinix
6 Replies

4. Shell Programming and Scripting

Cat 114 files using grep or awk to pull muliple fields

Files xxxxxxx.txt ------------------------------------------------------------------------------------------------------------------------------------ Req.By: xxxxxxx WABUSH MINES - xxxxxx MINE (1001) Page: 1 Run on: 12/14/09... (4 Replies)
Discussion started by: sctxms
4 Replies

5. Shell Programming and Scripting

Need script to pull multiple field from log file

I am hoping to get some help with a script to pull certain fields from a log file. User update (xx6xxx P) rpt (yy6yyy B) 2010/01/20 21:36:01.298 Remote client forward start streamid 85af 2010/01/20 21:36:01.307 rpt2 (ZZ6ZZZ G) rpt1 (YY6YYY B) urcall (CQCQCQ ) mycall (W1AW) user... (5 Replies)
Discussion started by: TedSD
5 Replies

6. Shell Programming and Scripting

Shell script for validating fields in a file

Hi, I have not used Unix in a very long time and I am very rusty. I would appreciate any help I can get from the more experienced and experts in Shell script. I am reading one file at a time from a folder. The file is a flat file with no delimeters or carriage return. Col1 through col6 is... (5 Replies)
Discussion started by: asemota
5 Replies

7. Shell Programming and Scripting

Script to pull hashes out of large text file

I am attempting to write a script that will pull out NTLM hashes from a text file that contains about 500,000 lines of data. Not all accounts contain hashes and I only need the ones that do contain hashes. Here is a sample of what the data looks like: There are thousands of other lines in... (6 Replies)
Discussion started by: chango77747
6 Replies

8. Shell Programming and Scripting

Aligning output with null fields in shell script

Hello Gurus ! I have what probably amounts to a few simply changes to fix; however for the life of me I cannot seem to get it ti work. I need to align the output of my script (I am writing to a logfile)... here's the lines in my code: if then echo "NODE: $node" >> $logfile... (6 Replies)
Discussion started by: gvolpini
6 Replies

9. Shell Programming and Scripting

How to get fields and get output with awk or shell script.?

I have a flat file A.txt with field seperate by a pipe 2012/11/13 20:06:11 | 284:hawk pid=014268 opened Locations 12, 13, 14, 15 for /home/hawk_t112/t112/macteam/qt/NET12/full_ddr3_2X_FV_4BD_1.qt/dbFiles/t112.proto|2012/11/14 15:19:26 | still running |norway|norway 2012/11/14 12:53:51 | ... (6 Replies)
Discussion started by: sabercats
6 Replies

10. Shell Programming and Scripting

Shell Script to Group by Based on Multiple Fields in a file

Hi, I want to know if there is any simple approach to SUM a field based on group by of different fields for e.g. file1.txt contains below data 20160622|XXX1||50.00||50.00|MONEY|Plan1| 20160622|XXX1||100.00||100.00|MONEY|Plan1| 20160623|XXX1||25.00||25.00|MONEY|Plan1|... (3 Replies)
Discussion started by: cnu_theprince
3 Replies
BACKUP_DELETEDUMP(8)					       AFS Command Reference					      BACKUP_DELETEDUMP(8)

NAME
       backup_deletedump - Deletes one or more dump records from the Backup Database

SYNOPSIS
       backup deletedump [-dumpid <dump id>+]
	   [-from <date time>+]
	   [-to <date time>+]
	   [-port <TC port offset>]
	   [-groupid <group ID>]
	   [-dbonly] [-force] [-noexecute] [-localauth]
	   [-cell <cell name>]
	   [-help]

       backup dele [-d <dump id>+]
	   [-fr <date time>+]
	   [-t <date time>+]
	   [-p <TC port offset>]
	   [-g <group ID>]
	   [-db] [-fo] [-n] [-l]
	   [-c <cell name>]
	   [-h]

DESCRIPTION
       The backup deletedump command deletes one or more dump records from the Backup Database. Either use the -dumpid argument to specify the
       dump ID number of one or more dumps, or use the -from and -to arguments to delete the records for all regular dumps created during the time
       period bracketed by the specified values.

       Use this command to remove dump records that are incorrect (possibly because a dump operation was interrupted or failed), or that
       correspond to dumps that are expired or otherwise no longer needed.

CAUTIONS
       The only way to remove the dump record for an appended dump is to remove the record for its initial dump, and doing so removes the records
       for all of the initial dump's associated appended dumps.

       The only way to remove the record for a Backup Database dump (created with the backup savedb command) is to specify its dump ID number with
       the -dumpid argument. Using the -from and -to arguments never removes database dump records.

       Removing records of a dump makes it impossible to restore data from the corresponding tapes or from any dump that refers to the deleted
       dump as its parent, directly or indirectly. That is, restore operations must begin with the full dump and continue with each incremental
       dump in order. If the records for a specific dump are removed, it is not possible to restore data from later incremental dumps unless the
       deleted records are restored by running the backup scantape command with the -dbadd flag.

       If a dump set contains any dumps that were created outside the time range specified by the -from and -to arguments, the command does not
       delete any of the records associated with the dump set, even if some of them represent dumps created during the time range.

OPTIONS
       -dumpid <dump id>+
	   Specifies the dump ID of each dump record to delete. The corresponding dumps must be initial dumps; it is not possible to delete
	   appended dump records directly, but only by deleting the record of their associated initial dump. Using this argument is the only way
	   to delete records of Backup Database dumps (created with the backup savedb command).

	   Provide either this argument or the -to (and optionally -from) argument.

       -from <date time>+
	   Specifies the beginning of a range of dates; the record for any dump created during the indicated period of time is deleted.

	   Omit this argument to indicate the default of midnight (00:00 hours) on 1 January 1970 (UNIX time zero), or provide a date value in the
	   format mm/dd/yyyy [hh:MM]. The month (mm), day (dd), and year (yyyy) are required. The hour and minutes (hh:MM) are optional, but if
	   provided must be in 24-hour format (for example, the value "14:36" represents 2:36 p.m.). If omitted, the time defaults to midnight
	   (00:00 hours).

	   The -to argument must be provided along with this one.

       -to <date time>+
	   Specifies the end of a range of dates; the record of any dump created during the range is deleted from the Backup Database.

	   Provide either the value "NOW" to indicate the current date and time, or a date value in the same format as for the -from argument.
	   Valid values for the year (yyyy) range from 1970 to 2037; higher values are not valid because the latest possible date in the standard
	   UNIX representation is in February 2038. The command interpreter automatically reduces any later date to the maximum value.

	   If the time portion (hh:MM) is omitted, it defaults to 59 seconds after midnight (00:00:59 hours). Similarly, the backup command
	   interpreter automatically adds 59 seconds to any time value provided. In both cases, adding 59 seconds compensates for how the Backup
	   Database and backup dumpinfo command represent dump creation times in hours and minutes only. For example, the Database records a
	   creation timestamp of "20:55" for any dump operation that begins between 20:55:00 and 20:55:59.  Automatically adding 59 seconds to a
	   time thus includes the records for all dumps created during that minute.

	   Provide either this argument, or the -dumpid argument.  This argument is required if the -from argument is provided.

	   Caution: Specifying the value "NOW" for this argument when the -from argument is omitted deletes all dump records from the Backup
	   Database (except for Backup Database dump records created with the backup savedb command).

       -localauth
	   Constructs a server ticket using a key from the local /etc/openafs/server/KeyFile file. The backup command interpreter presents it to
	   the Backup Server, Volume Server and VL Server during mutual authentication. Do not combine this flag with the -cell argument. For more
	   details, see backup(8).

       -cell <cell name>
	   Names the cell in which to run the command. Do not combine this argument with the -localauth flag. For more details, see backup(8).

       -help
	   Prints the online help for this command. All other valid options are ignored.

OUTPUT
       At the conclusion of processing, the output lists the dump IDs of all dump records deleted in the following format:

	  The following dumps were deleted:
	       dump ID 1
	       dump ID 2
	       etc.

EXAMPLES
       The following command deletes the dump record with dump ID 653777462, and for any appended dumps associated with it:

	  % backup deletedump -dumpid 653777462
	  The following dumps were deleted:
	       653777462

       The following command deletes the Backup Database record of all dumps created between midnight on 1 January 1997 and 23:59:59 hours on 31
       December 1997:

	  % backup deletedump -from 01/01/1997 -to 12/31/1997
	  The following dumps were deleted:
	       598324045
	       598346873
		  ...
		  ...
	       653777523
	       653779648

PRIVILEGE REQUIRED
       The issuer must be listed in the /etc/openafs/server/UserList file on every machine where the Backup Server is running, or must be logged
       onto a server machine as the local superuser "root" if the -localauth flag is included.

SEE ALSO
       backup(8), backup_dumpinfo(8), backup_scantape(8)

COPYRIGHT
       IBM Corporation 2000. <http://www.ibm.com/> All Rights Reserved.

       This documentation is covered by the IBM Public License Version 1.0.  It was converted from HTML to POD by software written by Chas
       Williams and Russ Allbery, based on work by Alf Wachsmann and Elizabeth Cassell.

OpenAFS 							    2012-03-26						      BACKUP_DELETEDUMP(8)
All times are GMT -4. The time now is 04:53 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy