09-21-2010
Grep by range of date from file creation in directory
Hi Expert,
Need your scripting and finding data so that it help me to find the culprit of this memory usage error.
Data provided here is a sample.
Process Snapshot directory: /var/spool/processes-snapshot
webdev9o9[93]% pwd
/var/spool/processes-snapshot
webdev9o9[97]% ls -lrct
-rw-r--r-- 1 root root 632 Sep 20 23:18 32590
-rw-r--r-- 1 root root 619 Sep 20 23:18 32586
-rw-r--r-- 1 root root 632 Sep 20 23:18 32577
-rw-r--r-- 1 root root 577 Sep 20 23:18 32573
-rw-r--r-- 1 root root 619 Sep 20 23:18 32562
-rw-r--r-- 1 root root 576 Sep 20 23:18 32559
-rw-r--r-- 1 root root 577 Sep 20 23:18 32549
-rw-r--r-- 1 root root 632 Sep 20 23:18 31010
What I want to achieve?
1. I would like to know base on /var/spool/processes-snapshot directory, where could I grep from certain time to certain time?
example from 20:00 t0 23:58 ?
2. And inside that file contain certain value that also could me, how could I grep by UID but showing by date of creation, then filter by range that I wanted?
e.g from certain time to certain time too?
sample output that I would like to have:
./24970:Uid: 10054 10054 10054 10054 Sep 20 23:18
webdev9o9 [98]% grep -r 10054 .
./24970:Uid: 10054 10054 10054 10054
./20861:Uid: 10054 10054 10054 10054
./30237:Uid: 10054 10054 10054 10054
./27920:Uid: 10054 10054 10054 10054
./15283:Uid: 10054 10054 10054 10054
./16827:Uid: 10054 10054 10054 10054
./7598:Uid: 10054 10054 10054 10054
./22903:Uid: 10054 10054 10054 10054
./20724:Uid: 10054 10054 10054 10054
webdev9o9[128]% cat 32590
Mon Sep 20 23:23:01 PDT 2010
Name: du
State: S (sleeping)
SleepAVG: 88%
Tgid: 32590
Pid: 32590
PPid: 32586
TracerPid: 0
Uid: 10054 10054 10054 10054
Gid: 1000 1000 1000 1000
FDSize: 64
Groups: 1000 5129 5130 8041
VmSize: 11648 kB
VmLck: 0 kB
VmRSS: 3296 kB
VmData: 1080 kB
VmStk: 2528 kB
VmExe: 317 kB
VmLib: 1479 kB
StaBrk: 00655000 kB
Brk: 006fa000 kB
StaStk: 7fbffffc90 kB
Threads: 1
SigPnd: 0000000000000000
ShdPnd: 0000000000000000
SigBlk: 0000000000000002
SigIgn: 0000000000000000
SigCgt: 0000000000012000
CapInh: 0000000000000000
CapPrm: 0000000000000000
CapEff: 0000000000000000
Thank you.
Reggy
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Dear Expert,
Is there a command to do that in Unix?
In such a way that we don't need to actually "write" or
modified the content.
-- monkfan (4 Replies)
Discussion started by: monkfan
4 Replies
2. Shell Programming and Scripting
hi all,
here is the description to my problem.
input parameters: $date1 & $date2
based on the range i need to select the archived files from the archived directory and moved them in to working directory.
can u please help me in writing the code to select the multiple files based on the... (3 Replies)
Discussion started by: bbc17484
3 Replies
3. Shell Programming and Scripting
Hi,
I need to search email files by date & time range in email files.
The timezone is not important.
Can someone plz advise how i can do this ?
For e.g A user can specify only
A single date
A date range
date & time range
Below is part of the email file. (4 Replies)
Discussion started by: coolatt
4 Replies
4. Shell Programming and Scripting
what's the command to find the creation date of a certain dirctory? (1 Reply)
Discussion started by: miss_dodi
1 Replies
5. UNIX Desktop Questions & Answers
how can i grep a range?
i have a text file with the following text:
result.log.00:2012/01/02 12:00:07.422 LOG STARTED HERE
N6Kashya29MemoryShieldScheduler_AO_IMPLE, pid=8662/8658,
config=(alertThreshold=10,alertLevel=0,killThreshold=7200,coreThreshold=0,full=1),
deltaTime=0,... (1 Reply)
Discussion started by: boaz733
1 Replies
6. Emergency UNIX and Linux Support
Hi All,
I am trying to to move files from a directory to another which falls from Current day - 7 days. The files are in zipped format with dates appended on it.
Can you pls help me as this came as a immediate change before the production Release planned next week.
Pls let me know if... (11 Replies)
Discussion started by: dsfreddie
11 Replies
7. Shell Programming and Scripting
Hi All,
Really stuck up with a requirement where I need to move a file (Lets say date_Employee.txt--the date will have different date values like 20120612/20120613 etc) from one directory to another based on creation/modification dates.
While visiting couple of posts, i could see we can... (3 Replies)
Discussion started by: dsfreddie
3 Replies
8. UNIX for Dummies Questions & Answers
Hi
I am unable to find files, those are present anywhere in the same directory tree, based on the creation date. I need to find the files with their path, as I need to create them in another location and move them. I need some help with a script that may do the job.
Please help (2 Replies)
Discussion started by: sam192837465
2 Replies
9. Shell Programming and Scripting
Hello, how in bash i can get directory loop and order by creation date?
THX! :)
#!/bin/bash
for folder in /home/test/*
do
if ; then
echo $folder;
fi (12 Replies)
Discussion started by: ZerO13
12 Replies
10. Shell Programming and Scripting
i read here that linux provides no way to determine when a directory was created.
https://www.unix.com/shell-programming-and-scripting/157874-creation-date-directory.htmlI have a directory /home/andy/scripts that had a README file in it.
That file says
I put the script in that directory and... (3 Replies)
Discussion started by: drew77
3 Replies
LEARN ABOUT OPENSOLARIS
conv_lp
conv_lp(1M) System Administration Commands conv_lp(1M)
NAME
conv_lp - convert LP configuration
SYNOPSIS
conv_lp [-d dir] [-f file]
DESCRIPTION
conv_lp reads LP printer configuration information from a directory and converts it to an output file for use with print client software.
OPTIONS
The following options are supported:
-d dir The root (` / ') directory from which LP configuration information is read. The default is root (` / ').
-f file The output file to which conv_lp writes the converted LP configuration information. The default is /etc/printers.conf.
EXAMPLES
Example 1 Converting LP Configuration Information from the Default Directory and File
The following example converts LP configuration information from directory root (/) to file /etc/printers.conf.
% conv_lp
Example 2 Converting LP Configuration Information From a Specified Directory and File
The following example converts LP configuration information from directory /export/root/client to file /export/root/client/etc/print-
ers.conf.
% conv_lp -d /export/root/client -f
/export/root/client/etc/printers.conf
EXIT STATUS
The following exit values are returned:
0 Successful completion.
non-zero An error occurred.
FILES
/etc/printers.conf System printer configuration database.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Availability |SUNWpcu |
+-----------------------------+-----------------------------+
SEE ALSO
lpset(1M), printers.conf(4), attributes(5)
SunOS 5.11 9 Sep 1996 conv_lp(1M)