capture all the today files


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting capture all the today files
# 1  
Old 07-22-2005
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  
Old 07-22-2005
# 3  
Old 07-25-2005
Thanks Vino! It works great.
# 4  
Old 07-28-2005
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

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Find files from only today

This finds files from yesterday and today. I need it to find only files from today. sudo find /home/andy -iname "*.sh" -mtime -1 -print (8 Replies)
Discussion started by: drew77
8 Replies

2. Shell Programming and Scripting

Search pattern in today's files only

Hi Friends, I am in search of unix command which can search a particular pattern in all files which are created/modified today ONLY. Which is the best way to achieve this? Thanks in advance. (1 Reply)
Discussion started by: Nakul_sh
1 Replies

3. Shell Programming and Scripting

Search files with today date and files come anytime in between 10 pm to 1 am

Hi, i want to make script. In a directory everyday( exclude sat and sun) in between 10 pm to 1 am there are 2 files comes and when file comes it will mail us. Format for files is mentioned below. please help me on making this, and also have year end consider and if files come after 12 am it... (6 Replies)
Discussion started by: pallvi_mahajan
6 Replies

4. Shell Programming and Scripting

Move all files except sys date (today) files in Solaris 10

I want to move all files from one directory to another directory excluding today (sysdate files) on daily basis. file name is in pattern file_2013031801, file_2013031802 etc (2 Replies)
Discussion started by: khattak
2 Replies

5. Shell Programming and Scripting

Files generated today

I would like to find the Files which are generated today in the current directory: I use the commad ls -lrt * | egrep " `date "+%b"` * `date "+%d"` to acheive this. Is there any better way to acquire the same. Multiple answers will be great. Thanks (3 Replies)
Discussion started by: kusathy
3 Replies

6. Shell Programming and Scripting

how to list all the files for today in the dir

I am trying following ... ls -ltrh | grep 'Dec 2' but it is displaying files for last year also ..as this dir is full of files from last 3-5 yrs I only want to files for today. e.g . ls -ltrh | grep 'Dec 2' -rw-r----- 1 ajay ajay 0 Dec 2 2010 text23.txt -rw-r----- ... (19 Replies)
Discussion started by: ajaypatil_am
19 Replies

7. Shell Programming and Scripting

Delete files older than today

is it -mtime +1 as i need all files older than today to be deleted (6 Replies)
Discussion started by: dinjo_jo
6 Replies

8. Shell Programming and Scripting

Calculate Files Created Today

I need to figure out how to get all the files from a certian dir ./123/*sat files and ./230/*sat files and several other directories which have these *sat files in them. I need to calculate how many were created today and how many yesterday from 2:00 pm on the 28th to 2pm on the 29th. It's a... (1 Reply)
Discussion started by: xgringo
1 Replies

9. UNIX for Dummies Questions & Answers

Sort files by date, not showing files from today

Hi all, i'm new here in this forum. I really like the helpful answers in this forum. Here a short question. For a script i have to sort files by date and exclude the files of the actual date. Sorting the files by date and preparing the output for awk is done by this line: ls -l... (3 Replies)
Discussion started by: carlosdivega
3 Replies

10. Shell Programming and Scripting

How to list today's files

Hi, I am trying to list names of only today's files OR say, files which are not older than 1 hour and copy them in 'list.txt' file. I know, :ls > list.txt will list all the files. But, how to list today's files? Any help will be appriciated. (4 Replies)
Discussion started by: berlin_germany
4 Replies
Login or Register to Ask a Question