The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Is rtc still needed today? sparkysun UNIX for Dummies Questions & Answers 2 03-28-2008 05:47 AM
How to list all the files which are not generated today redlotus72 UNIX for Dummies Questions & Answers 2 10-05-2007 06:27 AM
How to capture input files from GETOPT ? bh_hensem Shell Programming and Scripting 1 05-30-2007 11:31 PM
Need to capture spooled print files serware UNIX for Advanced & Expert Users 1 12-01-2001 11:36 PM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 07-21-2005
Registered User
 

Join Date: Jul 2005
Posts: 7
capture all the today files

My folder (e.g. /opt/successlog/) creates many files thru cron jobs everyday. I would like to retreive all the today files in this folder into a log file. How to do this for KSH? Thanks!
Reply With Quote
Forum Sponsor
  #2  
Old 07-21-2005
vino's Avatar
Supporter (in vino veritas)
 

Join Date: Feb 2005
Location: Bangalore, India
Posts: 2,698
Check out Perderabo's solution in find command

Vino
Reply With Quote
  #3  
Old 07-24-2005
Registered User
 

Join Date: Jul 2005
Posts: 7
Thanks Vino! It works great.
Reply With Quote
  #4  
Old 07-28-2005
Registered User
 

Join Date: Jul 2004
Location: Pacific NW, USA
Posts: 6
You can also check a different option for find command -

Quote:
-daystart
Measure times (for -amin, -atime, -cmin, -ctime, -mmin, and
-mtime) from the beginning of today rather than from 24 hours
ago.
For example -
Code:
EDIDIR=${LMS_EDI_IN}/${COMP}/${DIR}
FTPDIR=${LMS_VAR}/ftp/${COMP}/${DIR}
EDIINLIST=/app/lms/common/logs/admin/systemhealth/checkdailyinbounce_{$COMP}_${DIR}.log

find ${EDIDIR} -name "*.${EXT}" -daystart -mtime 0 -type f -exec ll {} \; > $EDIINLIST
find ${FTPDIR} -name "*.${EXT}" -daystart -mtime 0 -type f -exec ll {} \; >> $EDIINLIST

if [ ! -s $EDIINLIST ]
then
        echo "No ${REPNAME} file(s) received by LMS" | mailx -s "No inbound ${REPNAME} files for ${COMPNAME} received by LMS today " $MAILDL
else
        echo File Found
        cat $EDIINLIST
fi
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 09:30 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0