Sponsored Content
Full Discussion: Nested find cmd
Top Forums Shell Programming and Scripting Nested find cmd Post 302505711 by rsheikh on Thursday 17th of March 2011 03:44:44 PM
Old 03-17-2011
Hi there and thank you Corona688 and DGPicket for your time and advice.

I tried both suggestions. There are two things occurring:
1. stdout does show per dir listing of .log files, however, the last two in iteration also show a ls -l of the directory where this script is saved. Very odd.
Code:
#!/bin/sh
out=/usr/tmp/ct
  find /opt/sample -type d -name "Logs" 2>/dev/null | while read DIR
    do
      echo "****** Dir Name: $DIR ********"
      find $DIR -type f -name "*.log" |xargs -n999 ls -l
    done|tee $out

OS is Linux.

Noted your advice Corona. Also, will change the -atime. DG, your newer file example went way over my head Smilie
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Find cmd not working as expected

Hi, i wan to search the file starting with Admin into the directory Output. I am running below command: find /appl/Output -name "Admin*" -prune but this command is going into the sub directories present under output. I do not want to search under sub directories. Any help will be highly... (6 Replies)
Discussion started by: Vishal123
6 Replies

2. Solaris

Find cmd working in Linux and not in SunSolaris 5.8

find . -type f -mtime -1 -ls command not working in sun solaris 5.8 (4 Replies)
Discussion started by: navjotbaweja
4 Replies

3. Shell Programming and Scripting

using find cmd to find certain files

i have a list of files below: rwxrwxrwx 1 pipe pipe 180 Mar 4 22:47 del_0n_Date -rwxrwxrwx 1 pipe pipe 472 Mar 4 22:58 mail_Check -rw-r--r-- 1 pipe pipe 92 Mar 4 22:58 minfo.txt -rwxrwxrwx 1 pipe pipe 609 Mar 5 05:12... (6 Replies)
Discussion started by: ali560045
6 Replies

4. Shell Programming and Scripting

how to find status of last executed cmd in perl?

In shell we can find the status of last executed command by $? In perl what is the command to find the status of last executed command... Can any one please say??????????????? Thanks, Prabhu (1 Reply)
Discussion started by: prsampath
1 Replies

5. Shell Programming and Scripting

Find cmd not working correctly in script

I am trying to copy 2 types of files so I can archive them. I tested with a set of commands: touch -t $(date -d "-60 day" +%Y%m%d) WORKDIR/REF find TARGETDIR/ -type f -maxdepth 1 -iname \*.out\* -or -iname \*.log\* ! -newer WORKDIR/REF -exec ls -l {} \; This correctly lists any files in the... (2 Replies)
Discussion started by: prismtx
2 Replies

6. Shell Programming and Scripting

date with find cmd

Hi for today i have 10 files, in that i need search some values how can i write a find cmd with perticular date thanks SAIC (4 Replies)
Discussion started by: saic
4 Replies

7. Shell Programming and Scripting

How to link lsof and find cmd?

Hi All, My target is to find the biggest files opened by any process and from that i have to find process id and the corresponding file also to avoid file system being hung-up. Finding the process id: is to kill the process Finding the biggest file: is to remove the file To get the process... (0 Replies)
Discussion started by: Arunprasad
0 Replies

8. Shell Programming and Scripting

find cmd works different on cron job ?

/usr/bin/find $SEARCH_DIR -daystart \( \( -name 'KI*' -a -name '*.csv' \) -o -name '*_xyz_*' \) -mtime $DAYS_AGO -printf %f -printf "\n" | sort -r > $FILES The above command gives different results when run on a cron job. When run manually the result is accurate. (2 Replies)
Discussion started by: nuthalapati
2 Replies

9. UNIX for Dummies Questions & Answers

Help with the find cmd

Hello, I'm having a trouble with the find cmd. I would like to find all the java versions on my systems. I have solaris 9 & 10 RHEL and SUSIE. java -version doesn't give all the versions on the server. So I am trying to use the find command to find them all find / -name java I would... (7 Replies)
Discussion started by: bitlord
7 Replies

10. UNIX for Advanced & Expert Users

Find cmd and sym links

Hi. Can somebody tell me if there's a way of creating a symbolic link from a directory on one filesystem to that on another that will allow a find command that doesn't use the -L param to locate a particular file under that new 'linked' dir. With a normal sym link the find command on that... (6 Replies)
Discussion started by: user052009
6 Replies
OBNAM-BENCHMARK(1)					      General Commands Manual						OBNAM-BENCHMARK(1)

NAME
obnam-benchmark - benchmark obnam SYNOPSIS
obnam-benchmark [--config=FILE] [--description=DESCRIPTION] [--drop-caches] [--dump-config] [--dump-memory-profile=METHOD] [--dump-setting-names] [--file-size=SIZE] [--generate-manpage=TEMPLATE] [--generations=N] [-h] [--help] [--larch-branch=DIR] [--list-config-files] [--log=FILE] [--log-keep=N] [--log-level=LEVEL] [--log-max=SIZE] [--log-mode=MODE] [--no-default-configs] [--obnam-branch=DIR] [--output=FILE] [--profile-name=PROFILE-NAME] [--results=DIR] [--seivot-branch=DIR] [--seivot-log=SEIVOT-LOG] [--sftp-delay=SFTP-DELAY] [--size=PAIR] [--use-sftp-repository] [--use-sftp-root] [--verify] [--version] [--with-encryption] [FILE]... DESCRIPTION
obnam-benchmark benchmarks the obnam(1) backup application, by measuring how much time it takes to do a backup, restore, etc, in various scenarios. obnam-benchmark uses the seivot(1) tool for actually running the benchmarks, but makes some helpful assumptions about things, to make it simpler to run than running seivot directly. Benchmarks are run using two different usage profiles: mailspool (all files are small), and mediaserver (all files are big). For each pro- file, test data of the desired total size is generated, backed up, and then several incremental generations are backed up, each adding some more generated test data. Then other operations are run against the backup repository: restoring, listing the contents of, and removing each generation. The result of the benchmark is a .seivot file per profile, plus a Python profiler file for each run of obnam. These are stored in ../benchmarks. A set of .seivot files can be summarized for comparison with seivots-summary(1). The profiling files can be viewed with the usual Python tools: see the pstats module. The benchmarks are run against a version of obnam checked out from version control. It is not (currently) possible to run the benchmark against an installed version of obnam. Also the larch Python library, which obnam needs, needs to be checked out from version control. The --obnam-branch and --larch-branch options set the locations, if the defaults are not correct. OPTIONS
--config=FILE add FILE to config files --description=DESCRIPTION describe benchmark --drop-caches drop kernel buffer caches --dump-config write out the entire current configuration --dump-memory-profile=METHOD make memory profiling dumps using METHOD, which is one of: none, simple, meliae, or heapy (default: simple) --dump-setting-names write out all names of settings and quit --file-size=SIZE how big should files be? --generate-manpage=TEMPLATE fill in manual page TEMPLATE --generations=N benchmark N generations (default: 5) -h, --help show this help message and exit --larch-branch=DIR use DIR as the larch branch (default: /sbuild-nonexistent/larch/trunk) --list-config-files list all possible config files --log=FILE write log entries to FILE (default is to not write log files at all); use "syslog" to log to system log, or "none" to disable log- ging --log-keep=N keep last N logs (10) --log-level=LEVEL log at LEVEL, one of debug, info, warning, error, critical, fatal (default: debug) --log-max=SIZE rotate logs larger than SIZE, zero for never (default: 0) --log-mode=MODE set permissions of new log files to MODE (octal; default 0600) --no-default-configs clear list of configuration files to read --obnam-branch=DIR use DIR as the obnam branch to benchmark (default: .) --output=FILE write output to FILE, instead of standard output --profile-name=PROFILE-NAME short name for benchmark scenario --results=DIR put results under DIR (../benchmarks) --seivot-branch=DIR use DIR as the seivot branch (default: installed seivot) --seivot-log=SEIVOT-LOG seivot log setting --sftp-delay=SFTP-DELAY add artifical delay to sftp transfers (in milliseconds) --size=PAIR add PAIR to list of sizes to benchmark (e.g., 10g/1m) --use-sftp-repository access the repository over SFTP (requires ssh to localhost to work) --use-sftp-root access the live data over SFTP (requires ssh to localhost to work) --verify verify restores --version show program's version number and exit --with-encryption run benchmark using encryption ENVIRONMENT
TMPDIR This variable must be set. It controls where the temporary files (generated test data) is stored. If this variable was not set, they'd be put into /tmp, which easily fills up, to the detriment of the entire system. Thus. obnam-benchmark requires that the lo- cation is set explicitly. (You can still use /tmp if you want, but you have to set TMPDIR explicitly.) FILES
../benchmarks/ The default directory where results of the benchmark are stored, in a subdirectory named after the branch and revision numbers. EXAMPLE
To run a small benchmark: TMPDIR=/var/tmp obnam-benchmark --size=10m/1m To run a benchmark using existing data: TMPDIR=/var/tmp obnam-benchmark --use-existing=$HOME/Mail To view the currently available benchmark results: seivots-summary ../benchmarks/*/*mail*.seivot | less -S seivots-summary ../benchmarks/*/*media*.seivot | less -S (You need to run seivots-summary once per usage profile.) SEE ALSO
obnam(1), seivot(1), seivots-summary(1). OBNAM-BENCHMARK(1)
All times are GMT -4. The time now is 02:01 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy