My script takes a date range say 8 and it will fetch all the files between Current date to date which is 8 days ago.
if Current date is 23 Jul then files between 23 -15 Jul
po9999992,po9999991 is the group numbers.
Now if we take the example of po9999992 , we can see we have 2 files on Jul 20 and Jul 21 respectively. Jul 20 file is 0 KB . So I will take only Jul-21 file(latest file) which is non -zero size
For po9999991 we can see we have 2 files on Jul 23 and Jul 21 .the latest file is 0 KB . So I will not take either of the 2 files.
Thanks for replying. I dont have any working script yet. I am trying to do it. Is it possible to do using find command?
I have already explained exactly what I am looking for.
---------- Post updated at 01:43 PM ---------- Previous update was at 01:39 PM ----------
My requirement If for the same po9999992 there is two files . One is older than the other with the older one being 0 KB then I will take the Non Zero Latest file.
and If for the same po9999992 there is two files . One is older than the other with the lastest one being 0 KB then I will NOT take either of them.
The columns are size,date,file name, the bold texts represents a particular Order_no. Now if we take the example of po9999992 it has 2 files on Jul 20 and Jul 21. For this Order_No there was a 0 KB file on Jul 20 but later it has some in it.(Jul 21 file). So I will take the Non Zero file that was created later for this order_no. i.e. belk_rpo_error_po9999992_07212014.log
Now if we take the example of po9999991 it has 2 files on Jul 21 and Jul 23. Although it created a Non Zero file on 21st Later it produced a 0 KB file. So If I see from my current date (I.e. 24th Jul) I don't have any use for Jul 21st file as later it was 0 KB. So I will discard both of them.
The other 2 files are discarded
3679 Jan 25 23:59 belk_rpo_error_po9324892_01252014.log
0 Jul 01 06:30 belk_rpo_error_po9324267_07012014.log
as they don't fall within my provided date range.
For example if Sysdate is 24th July and I want to fetch last 8 day's file , Start date would be 16th July and End date 24th July.
MY Final Output is like
411 Jul 21 06:30 belk_rpo_error_po9999992_07212014.log