Sponsored Content
Top Forums UNIX for Dummies Questions & Answers output spacing and formatting Post 302708705 by prodigy06 on Tuesday 2nd of October 2012 04:47:52 AM
Old 10-02-2012
output spacing and formatting

here is my code and output, i just want to display it clearly to the users. how can I fix the spacing or put some headers like NAME, DEV id, Size, Meta

code:
Code:
symdg show $INS-${SNAP} | egrep "D-" | awk '{print $1,$3,$NF,$5}'

output:
Code:
D-arch 23C2 983040 (M)
D-db 0704 245760 (M)
D-undo 07DB 983040 (M)
D-temp 07E3 983040 (M)
D-index1 07EB 1966080 (M)
D-index2 07FB 1966080 (M)
D-index3 080B 1966080 (M)
D-data1 081B 1966080 (M)
D-data2 082B 1966080 (M)
D-data3 083B 1966080 (M)
D-data4 084B 1966080 (M)
D-data5 085B 1966080 (M)
D-data6 086B 1966080 (M)
D-data7 087B 1966080 (M)
D-redoa 0694 61440 (M)
D-redob 06A4 61440 (M)
D-cm 2306 737280 (M)
D-redoc 22F6 30720 (M)
D-redod 22FE 30720 (M)
D-rat 5CF9 491520 (M)
D-redoraw01a 5E51 30720 (M)
D-redoraw02a 5E59 30720 (M)
D-redoraw03a 5E61 30720 (M)
D-redoraw04a 5E69 30720 (M)
D-redoraw05a 5E71 30720 (M)
D-redoraw06a 5E79 30720 (M)
D-redoraw07a 5E81 30720 (M)
D-redoraw08a 5E89 30720 (M)


also, how do i tell awk to capture null values? because when i ask it to print $5 and if it has a null value there, it prints column 6 instead so its a bit inconsistent. thanks a lot in advance.

Last edited by Scrutinizer; 10-02-2012 at 06:06 AM.. Reason: code tags
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

formatting output

Hi need some advice.. #grep -i hostname test.csv (gives the below output) HOSTNAME,name,host_test,,,,,,,, Now I need to format the above output as below. HOSTNAME: name=host_test Any easy way of doing this using awk or sed or printf? (4 Replies)
Discussion started by: balaji_prk
4 Replies

2. Shell Programming and Scripting

formatting the output

Is it possible to convert the attached file to the format mentioned. Here for a particular job the table name and the corresponding instance name from one test run "X" is compared with the table name and the instance name from the second test run "Y" for output rows,affected rows,applied... (1 Reply)
Discussion started by: ragavhere
1 Replies

3. Shell Programming and Scripting

Formatting ls output

I am using find and ls to search for "warez" files on my server. find /home/ -regex ".*\.\(avi\|mp3\|mpeg\|mpg\|iso\)" -print0 | xargs -0 ls -oh This command produces this: -rw-r--r-- 1 1000 3.2M Feb 18 2009 /home/user/public_html/lupus.mp3 I want to only get this 3.2M... (4 Replies)
Discussion started by: bonrad
4 Replies

4. Shell Programming and Scripting

Formatting my output

Dear All, I am new to unix scripting. I need your help to format my output on screen. echo " --------------------------------------------" echo " | My Output |" echo " --------------------------------------------" echo " | A: $A... (5 Replies)
Discussion started by: rahiljavaid
5 Replies

5. Shell Programming and Scripting

Output formatting

I have input file in this way John 1234 BASIC 26000 John 1234 ALLOWC 01550 John 1234 INCER 01700 John 1234 REL 20000 Debi 2345 BASIC 29000 Debi 2345 ALLOWC 01600 Debi 2345 INCR 01900 Debi 2345 REL ... (8 Replies)
Discussion started by: vakharia Mahesh
8 Replies

6. Shell Programming and Scripting

Formatting of output

Hi Experts, I have to create a report for certain audit and my output looks as follows I m trying to format my output to look like Any inputs would be highly appreciated Thanks Syed (5 Replies)
Discussion started by: maverick_here
5 Replies

7. Shell Programming and Scripting

Output formatting .

below is a CPU utilization Log for ABC server. However for every 15 minutes it generates 3 CPU values(with interval of 2 sec). Host CPU CPUtotal CPU% time ABC 101.1 2 50.55 14 : 15 ABC 100.5 2 50.25 14 : 15 ABC 100.2 2 50.1 14 : 15 ABC 100.9 2 50.45 14 : 30 ABC 100.5 2 50.25 14 : 30 ABC... (5 Replies)
Discussion started by: pinga123
5 Replies

8. Shell Programming and Scripting

Preserving file format and spacing in output file

Hi I have a file with the following structure "VATTENFALL GLOBAL" "Vattenfall Tray" "BARCLAYS BANK LONDON" "Capula" "P1 AGEAS GLOBAL COMPANY" "AAC - Optiver" The requirement is like this 1) Take 2 input... (16 Replies)
Discussion started by: sudeep.id
16 Replies

9. Shell Programming and Scripting

Formatting output

I have the output like below: DEV#: 9 DEVICE NAME: hdisk9 TYPE: 1750500 ALGORITHM: Load Balance SERIAL: 68173531021 ========================================================================== Path# Adapter/Path Name State Mode Select Errors 0 ... (4 Replies)
Discussion started by: Daniel Gate
4 Replies

10. Shell Programming and Scripting

Formatting the Output

Hi, I am trying to use printf command and format certain output in a specific format as under: While the left side (upto |) of the above format is part of a fixed header function, the right side is where i am expecting data to be printed. However, as seen, Row1 value is reflecting on last... (5 Replies)
Discussion started by: EmbedUX
5 Replies
AMREPORT(8)						  System Administration Commands					       AMREPORT(8)

NAME
amreport - generate a formatted output of statistics for an Amanda run SYNOPSIS
amreport [-o configoption...] [(1) command-line options | (2) script options] [config] (1) [--log=logfile] [--ps=filename] [--text=filename] [--xml=filename] [--print=printer] [--mail-text=recipient] (2) [-i] [-M address] [-l logfile] [-f outputfile] [-p postscriptfile] [--from-amdump] DESCRIPTION
Amreport generates a summary report of an Amanda backup run. See the amanda(8) man page for more details about Amanda. OPTIONS
config Name of the configuration to process. If no configuration name is specified, amanda.conf is read from the current directory. -o configoption See the "CONFIGURATION OVERRIDE" section in amanda(8). Amreport operates in two distinct modes. Command-line mode is intended for use by an administrator from the command line, and uses long command-line options for clarity. Script mode is intended for use from scripts such as amdump, and has a lot of non-obvious default behaviors to suit that need. Unless a script-mode option is given, amreport defaults to command-line mode. If no options are given, amreport writes a report for the most recent logfile to stdout. Command-Line Mode Options --log=logfile Use this logfile as the basis for the report. If this option is given, then the report is a "historical" report and will not include current state from e.g., holding disk and curinfo. If this option is not specified, then the most recent logfile will be used. --ps=filename Write a postscript label to filename. See "LABEL PRINTING" below. If filename is not specified, then the label is written to stdout. --text=filename Write a human-readable text report to filename. If filename is not specified, then the report is written to stdout. --xml=filename Write an XML-formatted report to filename. If filename is not specified, then the report is written to stdout. --print=printer Pipe a postscript label to lp or lpr, specifying the given printer. If the printer is not specified, uses the default from the Amanda configuration, or the system default printer. --mail-text=recipient Send a human-readable text report to the given recipient via the mailer specified in the Amanda configuration. If the recipient is not specified, this uses the mailto from the Amanda configuration. Script Mode Options -i Don't email the report. -M address Mail the report to address instead of the mailto value from amanda.conf. -l logfile Name of the log file to parse to generate the report. If a log file is not specified, it defaults to the file $logdir/log, where $logdir is the log directory defined in amanda.conf. -f outputfile Normally, amreport sends the report via e-mail to the mailto user as defined in the amanda.conf file. If outputfile is specified, then the report is put in outputfile. -p postscriptfile Send the postscript output to the file postscriptfile instead of to the lpr(1) command. This option has an effect only if the lbl-templ directive is specified in amanda.conf. --from-amdump Force script mode. Has no other effect. TEXT REPORT FORMAT
Amanda's text report format is divided into several sections. Some of these sections only appear if they are not empty. Although newer versions of Amanda try to use the term "volume" to refer to a unit of storage, amreport still uses the term "tape", even if backups are done to non-tape devices, to allow scripts which parse amreport's output to continue to function. Summary Hostname: bkserver Org : DailySet1 Config : Daily Date : February 25, 2009 These dumps were to tape Daily-103. The next tape Amanda expects to use is: Daily-142 FAILURE DUMP SUMMARY: jamon.slikon.local /var lev 0 FAILED [/bin/tar exited with status 2] The summary section describes the run in broad terms, giving the server hostname, organization (from the org configuration parameter), configuration name, and dump date. This is followed by a description of the volumes and holding disk used, and an rough estimate of the volume(s) Amanda will use on the next run. Brief notices of any unusual circumstances will also be included here. Statistics STATISTICS: Total Full Incr. -------- -------- -------- Estimate Time (hrs:min) 0:00 Run Time (hrs:min) 0:01 Dump Time (hrs:min) 0:00 0:00 0:00 Output Size (meg) 1.6 0.0 1.6 Original Size (meg) 1.6 0.0 1.6 Avg Compressed Size (%) 100.0 100.0 100.0 (level:#disks ...) Filesystems Dumped 4 1 3 (1:3) Avg Dump Rate (k/s) 1555.1 134.2 1787.3 Tape Time (hrs:min) 0:00 0:00 0:00 Tape Size (meg) 1.6 0.0 1.6 Tape Used (%) 5.5 0.1 5.4 (level:#disks ...) Filesystems Taped 4 1 3 (1:3) (level:#parts ...) Parts Taped 4 1 3 (1:3) Avg Tp Write Rate (k/s) 143966 27624.3 151811 USAGE BY TAPE: Label Time Size % DLEs Parts metals-013 0:00 1650k 5.4 4 4 This section contains aggregate statistics for the entire run. The three columns break down the results into a total for all data handled, only full dumps, and only incremental dumps. In the right margin, amreport indicates the breakdown of dump levels at the dumper and the taper. The rows have the following meanings: Estimate Time The time used by the planner to estimate dump sizes. Run Time Total runtime, from the invocation of amdump to its completion. Dump Time Total time spent dumping clients. Output Size Total quantity of data dumped, after compression. Original Size Total quantity of data dumped, before compression. Avg Compressed Size Compression ratio, calculated from the previous two rows. Filesystems Dumped Number of DLEs dumped. Avg Dump Rate Average speed at which clients produced data. Note that, for dumps done directly to a slow device, rather than to holding disk, this rate may reflect a write speed constrained by the device speed. Tape Time Total time spent writing to storage volumes. This includes time spent changing tapes, including time spent waiting for flush thresholds to be met. Tape Size Total quantity of data written to storage volumes. Tape Used Fraction of the total allocated storage (tapetype length times runtapes) actually used. Filesystems Taped Number of filesystems written to storage. This may be larger or smaller than the number of filesystems dumped, due to flushes or dumps left on holding disk. Parts Taped Number of split parts writtten to storage. If this number is very large, then the split size may be too small. Avg Tp Write Rate Taper speed, based on the tape time and tape size, above. Note that, because the tape time includes time spent on tasks other than writing to tape, this does not necessary reflect the device's real write speed. However, the value is useful for capacity planning, as it reflects a realistic estimate of how quickly Amanda can write data to storage. Usage by Tape USAGE BY TAPE: Label Time Size % DLEs Parts Conf-001 0:00 20320k 66.2 1 4 Conf-002 0:00 6470k 21.1 0 2 This short section gives per-volume statistics: time spent writing to the volume; bytes written to the volume; portion of the expected tape length used; number of DLEs started, and total number of split parts written. Notes NOTES: taper: tape DAILY-37 kb 30720 fm 3 [OK] This section contains any informational log messages from the run. Most messages are self-explanatory. The taper message shown in the example is always present, and is redundant to the previous section. It indicates that 30720 kb were written to "DAILY-37" in 3 files. Failure and Strange Details FAILED DUMP DETAILS: /-- jamon.slikon.local /var lev 0 FAILED [/bin/tar exited with status 2] sendbackup: info BACKUP=APPLICATION sendbackup: info APPLICATION=amgtar sendbackup: info RECOVER_CMD=/usr/bin/gzip -dc |amgtar -f... - sendbackup: info COMPRESS_SUFFIX=.gz sendbackup: info end ? /bin/tar: ./gdm: Cannot savedir: Permission denied | Total bytes written: 943831040 (901MiB, 4.9MiB/s) | /bin/tar: Error exit delayed from previous errors sendbackup: error [/bin/tar exited with status 2] sendbackup: size 921710 sendbackup: end \-------- STRANGE DUMP DETAILS: /-- bsdfw.slikon.local / lev 0 STRANGE sendbackup: info BACKUP=APPLICATION sendbackup: info APPLICATION=amgtar sendbackup: info RECOVER_CMD=/usr/bin/gzip -dc |amgtar -f... - sendbackup: info COMPRESS_SUFFIX=.gz sendbackup: info end | /bin/tar: ./tmp/.X11-unix/X0: socket ignored | Total bytes written: 5530869760 (5.2GiB, 3.0MiB/s) sendbackup: size 5401240 sendbackup: end \-------- This section expands on failures and strange results indicated in earlier sections. In both cases, the details contain a messages produced by the underlying backup tool - GNU tar, in this example. Failed dumps have actually failed, and the reasons are usually clear. Strange dumps, however, are regarded as successful by Amanda, but contain messages that Amanda did not recognize and which may be of interest to the operator. Dump Summary DUMP SUMMARY: DUMPER STATS TAPER STATS HOSTNAME DISK L ORIG-kB OUT-kB COMP% MMM:SS KB/s MMM:SS KB/s -------------------------- ------------------------------------- --------------- strontium /etc 1 270 270 -- 0:00 1146.3 0:00 140918.6 strontium -me/elantra 1 10 10 -- 0:00 65.6 0:00 9033.4 strontium /local 0 20 20 -- 0:00 133.9 0:00 27624.3 strontium -ository_13 1 1350 1350 -- 0:01 2568.5 0:00 175006.5 The dump summary table has one row for each DLE processed during the run. The "L" column gives the level of the dump. The remaining colums are divided into dumper stats and taper stats. The dumper stats give the original (before compression) and output (after compression) size of each dump, as well as a compression ratio, if applicable. The column labeled "MMM:SS" gives the time spent on that dump, and the next column is the calculated dump rate. The taper stats give the time and speed with which the dump was written to storage. This value is the sum of the times for each part, and as such does not include time spent switching volumes. LABEL PRINTING
Amanda can print postscript labels describing the contents of tape(s) written in a run. The labels are designed to be folded and inserted into the tape case along with the tape or hole punched and put in a 3-ring binder. Various label templates are provided to format data for different tape sizes. The information printed varies slightly between label templates due to size constraints. Labels contain one line for each host/file-system pair and may also contain the file number on the tape, the level of the dump, the original size of the dump and the size of the (possibly compressed) tape file. Add the lbl-templ parameter to the tapetype definition in amanda.conf to enable labels. If you don't add this line to your tapetype definition, amreport will not print tape labels. You may use the printer keyword in amanda.conf to print to other than the system default printer. TEMPLATES
Amanda provides label templates for the following tape types. These are pretty generic labels and should be easy to customize for other tape types or particular site needs. * ExaByte 8mm tapes * DAT 4mm tapes * DLT tapes * 3-ring binder The 3-ring binder type is the most generic. It may be used to make a hardcopy log of the tapes. EXIT CODE
The exit code of amreport is the ORed value of: 0 = success 1 = error 2 = a dle give strange message 4 = a dle failed 8 = Don't know the status of a dle (RESULT_MISSING in the report) 16 = tape error or no more tape SEE ALSO
amanda(8), amflush(8) The Amanda Wiki: : http://wiki.zmanda.com/ AUTHOR
Stefan G. Weichinger <sgw@amanda.org> Amanda 3.3.3 01/10/2013 AMREPORT(8)
All times are GMT -4. The time now is 09:39 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy