Bash Script

Hi Team,

I have a requirement where I need to fetch latest files received today. This means

Ex:  path /bin/Parent_folder
In this Parent_folder we have 10 child directories. Vendors places files into these child directories respectively on different dates.

Now I need the list of files with folder name - received/added to these child directories.

Ex : If vendor places one new file in  child_folder2 and two new files in child_folder 5 then
I need this details to be logged to some txt/csv files.

I am sorry if my requirement is not clear, please let me know if you have more questions.

Thank you so much
parpaaAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

farzanjCommented:
It appears that you need a find command

find /bin/Parent_folder -type f -mtime -2 > log.txt

So basically in this path any ordinary file that has been modified for less than 2 days.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
parpaaAuthor Commented:
Hi farzanj,

This is great, You are right this is something I am looking for.

Can I also add last modified date to this log.txt ?

Thank you so much for your help here. Much appreciated.
0
MikeOM_DBACommented:
Adding to farzanj's comment, I would recommend that once you "process" the received files, move them to another directory and maintain the receiving directories "clean".
0
parpaaAuthor Commented:
This is great Thank you
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Shell Scripting

From novice to tech pro — start learning today.