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 and shell scripting languages 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 08:47 AM
How to list all the files which are not generated today redlotus72 UNIX for Dummies Questions & Answers 2 10-05-2007 10:27 AM
How to capture input files from GETOPT ? bh_hensem Shell Programming and Scripting 1 05-31-2007 03:31 AM
Need to capture spooled print files serware UNIX for Advanced & Expert Users 1 12-02-2001 02:36 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 07-22-2005
Teh Tiack Ein Teh Tiack Ein is offline
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!
  #2 (permalink)  
Old 07-22-2005
vino's Avatar
vino vino is offline Forum Staff  
Supporter (in vino veritas)
  
 

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

Vino
  #3 (permalink)  
Old 07-25-2005
Teh Tiack Ein Teh Tiack Ein is offline
Registered User
  
 

Join Date: Jul 2005
Posts: 7
Thanks Vino! It works great.
  #4 (permalink)  
Old 07-28-2005
NPRao NPRao is offline
Registered User
  
 

Join Date: Aug 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

Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 06:22 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0