Hey all.. This should be simple but stoopid here can't get head around it! I have many directories, say 100 each with many files inside. I need a script to traverse through the dirs, find most recent file in each dir and add it to a tar file.
I can find the files with something like
for DIR in `find /My/Dirs/ -type d`
do
ls -l -rt $DIR |tail -1
done
But how to get that into a tar?? Am i thinking about it all wrong?
BTW i can't just use find as the latest file in the dir could be new or old..