tru64-unix-managers (formerly alpha-osf-managers) (1994-2012)
 help / color / mirror / Atom feed
From: carole () callutheran ! edu (Carole Thompson)
To: tru64-unix-managers
Subject: Q: how to extract a changing dir name
Date: Tue, 17 Sep 1996 17:17:56 +0000	[thread overview]
Message-ID: <96076339121511.tru64-unix-managers.marc@archive.invalid> (raw)

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

                 reply	other threads:[~1996-09-17 17:17 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox