* Q: how to extract a changing dir name
@ 1996-09-17 17:17 carole
0 siblings, 0 replies; only message in thread
From: carole @ 1996-09-17 17:17 UTC (permalink / raw)
To: tru64-unix-managers
I would like to create a script which culls statistics about logins, su
attempts, connects, etc. from the log files contained in the
syslog.dated/<dated directory> I recycle my system daily after backup to
cleanup defunct processes, so a new <dated directory> is created every day.
How can I extract the exact name and plug it into a script so that I can cd
to it, and run greps and wc commands, etc on the log files? For example, I
would have to ls the /var/adm/syslog.dated directory, and extract as a
string the directory name 17-Sep-03:12 then cd
/var/adm/syslog.dated/17-Sep-03:12
Does anyone have code or a monitoring scripts you'd be willing to share?
Thanks.
Carole Thompson
California Lutheran University
carole@callutheran.edu
# pwd
/usr/var/adm/syslog.dated
# ls -ls
total 8
1 drwxr-xr-x 2 root adm 512 Sep 12 04:28 12-Sep-04:28
1 drwxr-xr-x 2 root adm 512 Sep 13 04:28 13-Sep-04:28
1 drwxr-xr-x 2 root adm 512 Sep 14 04:29 14-Sep-04:29
1 drwxr-xr-x 2 root adm 512 Sep 15 03:11 15-Sep-03:11
1 drwxr-xr-x 2 root adm 512 Sep 16 03:11 16-Sep-03:11
1 drwxr-xr-x 2 root adm 512 Sep 17 03:12 17-Sep-03:12
# cd 17-Sep-03:12
# ls
auth.log kern.log mail.log user.log
daemon.log lpr.log syslog.log
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~1996-09-17 17:17 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1996-09-17 17:17 Q: how to extract a changing dir name carole
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox