Sponsored Content
Top Forums Shell Programming and Scripting disk space used for files with in a directory structure. Post 60300 by kasala on Friday 14th of January 2005 11:32:38 AM
Old 01-14-2005
disk space used for files with in a directory structure.

Hello,
I am new to shell scripting and would really appreciate if someone could help me with this question.

I have a directory structure as follows..
main directory is DATA under which i have different directories names fileserver01, fileserver02 ... till fileserver 15.

under each of these there are more subdirectories named
123456, 123567,123984..... 234859,234503.. etc.

under each of these six digit subdirectory there are more subdirectories named subdir1, subdir2, subdir3... subdir7, which in turn contains individual files.

Now, my question is.. how can I find the disk space used by certain amount of files(not starting with "deleted") under subdir1,subdir3 and subdir4. also, the disk space should be based on the first three digits of the directories starting with eg..123, 234 etc.
ie. I need to find the diskspace of DATA/iterate thro' all fileservers/grouped under the matching first three digits eg 123*)/specified directories eg.subdir1,subdir3,subdir4)/(files not starting with "deleted").
I hope my question is clear.
I am using Ksh.

Thanks in advace.
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

How do I increase disk space available to a directory?

I know very basic Unix commands s I would really appreacite the assistance of a Unix guru. I am installing an application on a Sun server, when attempting to install I get an error that says I do not have enough sapce allocated for my install directory. Error says it has 7235m but needs 15360m.... (2 Replies)
Discussion started by: rhack
2 Replies

2. UNIX for Advanced & Expert Users

MV files from one directory structure(multiple level) to other directory structure

Hi, I am trying to write a script that will move all the files from source directory structure(multiple levels might exist) to destination directory structure. If a sub folder is source doesnot exist in destination then I have to skip and goto next level. I also need to delete the files in... (4 Replies)
Discussion started by: srmadab
4 Replies

3. UNIX for Dummies Questions & Answers

copy files with directory structure

i have a text file as. /database/sp/NTR_Update_Imsi_List.sql /database/sp/NTR_Update_Imsi_Range_List.sql /database/sp/NTR_Vlr_Upload.sql /database/tables/StatsTables.sql /mib/ntr.mib /mib/ntr.v2.mib /scripts/operations/ntr/IMSITracer.ph /scripts/operations/ntr/IMSITracer.pl ... (3 Replies)
Discussion started by: adddy
3 Replies

4. SCO

Transfer files wih directory structure.

I need to transfer software off a SCO OpenServer 5.0.5 server. I can not seem to read this server's tape on my other server since the tape drive (IBM Gen 5 DAT 72GB) will continuosly "eject" this DAT 8 tape. I have been able to 'tarball' most of the smaller directories with success and... (11 Replies)
Discussion started by: uxlunatick
11 Replies

5. Shell Programming and Scripting

Script to remove all empty files within the directory structure?

Hi I need to write a shell script which basically searches for all the empty files within the directory structure, lists them before asking the user to confirm if they would like to delete them. If the user deletes the file then a notice would appear confirming the file is deleted. I've be... (5 Replies)
Discussion started by: cat123
5 Replies

6. Programming

C++: how to check my directory disk space

I have a directory, and I write some files in to that. How to throw the error exception when my directory is full. i.e. there is no disk space (2 Replies)
Discussion started by: SamRoj
2 Replies

7. Shell Programming and Scripting

How to traverse directory structure and sum size of files?

How do I write a bash or ruby or perl or groovy script to print all the files in my directory tree that are one-to-two years old, the size of each file, and the sum of file sizes and then delete them? I was using find . -atime +365 -exec rm '{}' \; but the problem was that I could not... (5 Replies)
Discussion started by: siegfried
5 Replies

8. Shell Programming and Scripting

Extract files from tar ball without directory structure

Hi, I have tar filw which has multiple directories which contain files. When i extract using tar -xf the directory structure also get extracted. I require only files and not directory structures as there will be overhead of moving the files again. So i searched here and got a solution but... (4 Replies)
Discussion started by: chetan.c
4 Replies

9. Shell Programming and Scripting

Archiving files keeping the same structure directory

Hello Team, We would like to backup a lot of files inside of a structure of directories, four, five or more levels in some Ubuntu, Mac and Solaris systems. For instance: /home/chuck/sales/virgin/rent-quote.pdf /home/chuck/sales/marriott/vacation-quote.pdf... (2 Replies)
Discussion started by: csierra
2 Replies
geninfo(1)							   User Manuals 							geninfo(1)

NAME
geninfo - Generate tracefiles from .da files SYNOPSIS
geninfo [-h|--help] [-v|--version] [-q|--quiet] [-i|--initial] [-t|--test-name test-name] [-o|--output-filename filename] [-f|--follow] [-b|--base-directory directory] [--checksum] [--no-checksum] [--compat-libtool] [--no-compat-libtool] [--gcov-tool tool] [--ignore-errors errors] [--no-recursion] directory DESCRIPTION
geninfo converts all GCOV coverage data files found in directory into tracefiles, which the genhtml tool can convert to HTML output. Unless the --output-filename option is specified, geninfo writes its output to one file per .da file, the name of which is generated by simply appending ".info" to the respective .da file name. Note that the current user needs write access to both directory as well as to the original source code location. This is necessary because some temporary files have to be created there during the conversion process. Note also that geninfo is called from within lcov, so that there is usually no need to call it directly. Exclusion markers To exclude specific lines of code from a tracefile, you can add exclusion markers to the source code. Exclusion markers are keywords which can for example be added in the form of a comment. The following markers are recognized by geninfo: LCOV_EXCL_LINE Lines containing this marker will be excluded. LCOV_EXCL_START Marks the beginning of an excluded section. The current line is part of this section. LCOV_EXCL_STOP Marks the end of an excluded section. The current line not part of this section. OPTIONS
-b directory --base-directory directory Use directory as base directory for relative paths. Use this option to specify the base directory of a build-environment when geninfo produces error messages like: ERROR: could not read source file /home/user/project/subdir1/subdir2/subdir1/subdir2/file.c In this example, use /home/user/project as base directory. This option is required when using geninfo on projects built with libtool or similar build environments that work with a base direc- tory, i.e. environments, where the current working directory when invoking the compiler is not the same directory in which the source code file is located. Note that this option will not work in environments where multiple base directories are used. In that case repeat the geninfo call for each base directory while using the --ignore-errors option to prevent geninfo from exiting when the first source code file could not be found. This way you can get partial coverage information for each base directory which can then be combined using the -a option. --checksum --no-checksum Specify whether to generate checksum data when writing tracefiles. Use --checksum to enable checksum generation or --no-checksum to disable it. Checksum generation is disabled by default. When checksum generation is enabled, a checksum will be generated for each source code line and stored along with the coverage data. This checksum will be used to prevent attempts to combine coverage data from different source code versions. If you don't work with different source code versions, disable this option to speed up coverage data processing and to reduce the size of tracefiles. --compat-libtool --no-compat-libtool Specify whether to enable libtool compatibility mode. Use --compat-libtool to enable libtool compatibility mode or --no-compat-libtool to disable it. The libtool compatibility mode is enabled by default. When libtool compatibility mode is enabled, geninfo will assume that the source code relating to a .da file located in a directory named ".libs" can be found in its parent directory. If you have directories named ".libs" in your build environment but don't use libtool, disable this option to prevent problems when capturing coverage data. -f --follow Follow links when searching .da files. --gcov-tool tool Specify the location of the gcov tool. -h --help Print a short help text, then exit. --ignore-errors errors Specify a list of errors after which to continue processing. Use this option to specify a list of one or more classes of errors after which geninfo should continue processing instead of abort- ing. errors can be a comma-separated list of the following keywords: gcov: the gcov tool returned with a non-zero return code. source: the source code file for a data set could not be found. -i --initial Capture initial zero coverage data. Run geninfo with this option on the directories containing .bb, .bbg or .gcno files before running any test case. The result is a "baseline" coverage data file that contains zero coverage for every instrumented line and function. Combine this data file (using lcov -a) with coverage data files captured after a test run to ensure that the percentage of total lines covered is correct even when not all object code files were loaded during the test. Note: currently, the --initial option does not generate branch coverage information. --no-recursion Use this option if you want to get coverage data for the specified directory only without processing subdirectories. -o output-filename --output-filename output-filename Write all data to output-filename. If you want to have all data written to a single file (for easier handling), use this option to specify the respective filename. By default, one tracefile will be created for each processed .da file. -q --quiet Do not print progress messages. Suppresses all informational progress output. When this switch is enabled, only error or warning messages are printed. -t testname --test-name testname Use test case name testname for resulting data. Valid test case names can consist of letters, decimal digits and the underscore character ('_'). This proves useful when data from several test cases is merged (i.e. by simply concatenating the respective tracefiles) in which case a test name can be used to differentiate between data from each test case. -v --version Print version number, then exit. FILES
/etc/lcovrc The system-wide configuration file. ~/.lcovrc The per-user configuration file. Following is a quick description of the tracefile format as used by genhtml, geninfo and lcov. A tracefile is made up of several human-readable lines of text, divided into sections. If available, a tracefile begins with the testname which is stored in the following format: TN:<test name> For each source file referenced in the .da file, there is a section containing filename and coverage data: SF:<absolute path to the source file> Following is a list of line numbers for each function name found in the source file: FN:<line number of function start>,<function name> Next, there is a list of execution counts for each instrumented function: FNDA:<execution count>,<function name> This list is followed by two lines containing the number of functions found and hit: FNF:<number of functions found> FNH:<number of function hit> Branch coverage information is stored which one line per branch: BRDA:<line number>,<block number>,<branch number>,<taken> Block number and branch number are gcc internal IDs for the branch. Taken is either '-' if the basic block containing the branch was never executed or a number indicating how often that branch was taken. Branch coverage summaries are stored in two lines: BRF:<number of branches found> BRH:<number of branches hit> Then there is a list of execution counts for each instrumented line (i.e. a line which resulted in executable code): DA:<line number>,<execution count>[,<checksum>] Note that there may be an optional checksum present for each instrumented line. The current geninfo implementation uses an MD5 hash as checksumming algorithm. At the end of a section, there is a summary about how many lines were found and how many were actually instrumented: LH:<number of lines with a non-zero execution count> LF:<number of instrumented lines> Each sections ends with: end_of_record In addition to the main source code file there are sections for all #included files which also contain executable code. Note that the absolute path of a source file is generated by interpreting the contents of the respective .bb file (see gcov (1) for more information on this file type). Relative filenames are prefixed with the directory in which the .bb file is found. Note also that symbolic links to the .bb file will be resolved so that the actual file path is used instead of the path to a link. This approach is necessary for the mechanism to work with the /proc/gcov files. AUTHOR
Peter Oberparleiter <Peter.Oberparleiter@de.ibm.com> SEE ALSO
lcov(1), genhtml(1), genpng(1), gendesc(1), gcov(1) 2010-08-06 LCOV 1.9 geninfo(1)
All times are GMT -4. The time now is 02:57 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy