Sponsored Content
Full Discussion: CPU Consumption comparision.
Top Forums Shell Programming and Scripting CPU Consumption comparision. Post 302217789 by Prateek007 on Wednesday 23rd of July 2008 02:39:49 PM
Old 07-23-2008
In the below mentioned script :

[#!/bin/ksh
Home="/tmp/Text"
Path="/abc/def"
find $Path -mtime -1 -print | xargs ls -ld > $Home # Putting latest 24 hours files in $Home

cat $Home | while read line
do
File=$(echo $line|awk '{print $4}');

if [[ -f "$File.SP" ]]
then
echo " File $File is Correct"
else
echo "File $File is Missed"
fi
]

i am checking for the files which are received in last 24 hours( almost 1000 files) in my system and they have their corresponding ".SP" file generated, if not then its a MISS.
Here i am checking 1000 files one by one that their corresponding ".SP" is generated or not. can i have any way common by which i can put this check for more than a file at a time, to minimize the run time of the script?

i mean can we parallely run multiple checks like threading??
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

CPU consumption

Hello experts, I am writing an application in Solaris, which is supposed to work on PrimePower 650 and SunFire 440 machines. The application listens to the events raised by the Hardware and OS in /dev/log. The application listens to the messages logged into /dev/log and do some processing on... (3 Replies)
Discussion started by: pleaseteachmeun
3 Replies

2. SCO

Ghost Process + CPU consumption

Hi everyone, I have a problem on sco unixware 7.1.4 a Ghost process is consuming cpu usage. rtpm cpu 0 ======--------- cpu 1 ===--------------------- cpu 2 ============================================================----------- cpu 3 ... (1 Reply)
Discussion started by: neal.opperman
1 Replies

3. UNIX for Dummies Questions & Answers

how to get persistant cpu utilization values per process per cpu in linux (! top,ps)

hi, i want to know cpu utilizatiion per process per cpu..for single processor also if multicore in linux ..to use these values in shell script to kill processes exceeding cpu utilization.ps (pcpu) command does not give exact values..top does not give persistant values..psstat,vmstat..does njot... (3 Replies)
Discussion started by: pankajd
3 Replies

4. AIX

consumption memory

Hi, I have a problem with memory on AIX 5.3. On this server, we have JDE Edwards (ERP) and Oracle Database (9.2.0.7.0). We have 4 Gb for physical memory and 3 Gb for paging space. When I stop all services (JDE, Oracle and all other services), the physical memory is not free (4 Gb) svmon... (9 Replies)
Discussion started by: tagger
9 Replies

5. Shell Programming and Scripting

Shell script to display top 5 process (per cpu consumption)

Hello, I have to create shell script being myself real novice in scripting... I was looking on the Internet for some script examples, but I don't have the basic understanding of the shell. I was trying to do something with “ps” command without success. For exemple total number of... (2 Replies)
Discussion started by: mr_awd
2 Replies

6. Solaris

Multi CPU Solaris system shows 100% CPU usage.

Hello Friends, On one of my Solaris 10 box, CPU usage shows 100% using "sar", "vmstat". However, it has 4 CPUs and prstat and glance are not showing enough processes to justify high CPU utilization. ========================================================================= $ prstat -a ... (4 Replies)
Discussion started by: mahive
4 Replies

7. UNIX for Advanced & Expert Users

Help! CPU consumption - %usr and %sys ??

On Linux, top shows how much % of CPU is consumed by "user" as well as "sys" like below. Tasks: 272 total, 3 running, 268 sleeping, 0 stopped, 1 zombie Cpu(s): 65.9%us, 33.8%sy, 0.0%ni, 0.2%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st Mem: 16300960k total, 16212488k used, 88472k free, ... (0 Replies)
Discussion started by: gomes1333
0 Replies

8. Solaris

Problem with Swap consumption

Hi Experts, I have M4000 server with 132 GB Physical memory. 4 sparse zones are running under this server, which are running multiple applications. I am not getting any pointer, where swap space is getting consumed. Almost 97% of swap space is being used. I checked all /tmp (of zones as well),... (7 Replies)
Discussion started by: solaris_1977
7 Replies

9. UNIX Desktop Questions & Answers

Regarding Memory Consumption

Hi All I am new to UNIX ,can any one please help in finding MEMORY CONSUMPTION of VLC when i use it as Streaming Server. I need to log the memory consumption for atleast 10 hours. Can any one help me in finding this Please (1 Reply)
Discussion started by: ravikanth17
1 Replies

10. Red Hat

Understanding cpu consumption with TOP

Hi please see attached picture of the TOP command. the "java" process seem to consume 700% of cpu is that mean that he uses 100% of every 7 cpu cores? thanks (2 Replies)
Discussion started by: guy3145
2 Replies
File::Fu(3pm)						User Contributed Perl Documentation					     File::Fu(3pm)

NAME
File::Fu - file and directory objects SYNOPSIS
The directory constructor: use File::Fu; my $dir = File::Fu->dir("bar"); print "$dir "; # 'bar/' my $file = $dir + 'bar.txt'; print "$file "; # 'bar/bar.txt' my $d2 = $dir % 'baz'; # 'barbaz/' my $d3 = $dir / 'bat'; # 'bar/bat/' my $file2 = $dir / 'bat' + 'foo.txt'; # 'bar/bat/foo.txt' The file constructor: my $file = File::Fu->file("foo"); $file->e and warn "$file exists"; $file->l and warn "$file is a link"; warn "file is in ", $file->dir; ABOUT
This class provides the toplevel interface to File::Fu directory and file objects, with operator overloading which allows precise path composition and support for most builtin methods, as well as creation of temporary files/directories, finding files, and more. The interface and style are quite different than the perl builtins or File::Spec. The syntax is concise. Errors are thrown with croak(), so you never need to check a return code. Constructors The actual objects are in the 'Dir' and 'File' sub-namespaces. dir my $dir = File::Fu->dir($path); See "new" in File::Fu::Dir file my $file = File::Fu->file($path); See "new" in File::Fu::File Class Constants tmp Your system's '/tmp/' directory (or equivalent of that.) my $dir = File::Fu->tmp; home User's $HOME directory. my $dir = File::Fu->home; program_name The absolute name of your program. This will be relative from the time File::Fu was loaded. It dies if the name is '-e'. my $prog = File::Fu->program_name; If File::Fu was loaded after a chdir and the $0 was relative, calling program_name() throws an error. (Unless you set $0 correctly before requiring File::Fu.) program_dir Returns what typically corresponds to program_name()->dirname, but just the compile-time cwd() when $0 is -e/-E. my $dir = File::Fu->program_dir; Class Methods THIS_FILE A nicer way to say __FILE__. my $file = File::Fu->THIS_FILE; cwd The current working directory. my $dir = File::Fu->cwd; which Returns File::Fu::File objects of ordered candidates for $name found in the path. my @prog = File::Fu->which($name) or die "cannot find $name"; If called in scalar context, returns a single File::Fu::File object or throws an error if no candidates were found. my $prog = File::Fu->which($name); Temporary Directories and Files These class methods call the corresponding File::Fu::Dir methods on the value of tmp(). That is, you get a temporary file/dir in the '/tmp/' directory. temp_dir my $dir = File::Fu->temp_dir; temp_file my $handle = File::Fu->temp_file; Subclassing You may wish to subclass File:Fu and override the dir_class() and/or file_class() class methods to point to your own Dir/File subclasses. my $class = 'My::FileFu'; my $dir = $class->dir("foo"); See File::Fu::File and File::Fu::Dir for more info. See Also File::Fu::why if I need to explain my motivations. Path::Class, from which many an idea was taken. File::stat, IO::File, File::Spec, File::Find, File::Temp, File::Path, File::Basename, perlfunc, perlopentut. AUTHOR
Eric Wilhelm @ <ewilhelm at cpan dot org> http://scratchcomputing.com/ BUGS
If you found this module on CPAN, please report any bugs or feature requests through the web interface at <http://rt.cpan.org>. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes. If you pulled this development version from my /svn/, please contact me directly. COPYRIGHT
Copyright (C) 2008 Eric L. Wilhelm, All Rights Reserved. NO WARRANTY
Absolutely, positively NO WARRANTY, neither express or implied, is offered with this software. You use this software at your own risk. In case of loss, no person or entity owes you anything whatsoever. You have been warned. LICENSE
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.10.1 2010-05-13 File::Fu(3pm)
All times are GMT -4. The time now is 09:30 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy