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 shows date of previous in filename.

 ls -lrt | tail  -rw-rw----    1 aibarkr2 aibark     37397479 Oct 17 22:14 batm53_20131017_BARC5300001201310170000000200004233.221341696408
  -rw-rw----    1 aibarkr2 aibark    620963845 Oct 17 22:56 batm53_20131017_BARC5300001201310170000000100193868.225022664298
  -rw-rw----    1 aibarkr2 aibark      6105620 Oct 19 00:33 batm53_20131019_BARC5300001201310180000000200008798.003410428376
  -rw-rw----    1 aibarkr2 aibark    714987170 Oct 19 01:14 batm53_20131019_BARC5300001201310180000000100179608.011058444311
  -rw-rw----    1 aibarkr2 aibark      1513941 Oct 21 22:20 batm53_20131021_BARC5300001201310210000000200001064.222345400253
  -rw-rw----    1 aibarkr2 aibark    761353431 Oct 21 23:07 batm53_20131021_BARC5300001201310210000000100179307.230054883420
  -rw-rw----    1 aibarkr2 aibark      3488099 Oct 22 22:27 batm053_20131022_BARC5300001201310220000000200002859.222646691462
  -rw-rw----    1 aibarkr2 aibark    662128252 Oct 22 23:05 batm53_20131022_BARC5300001201310220000000100174007.230205970923
  -rw-rw----    1 aibarkr2 aibark      2143648 Oct 23 22:20 batm53_20131023_BARC5300001201310230000000200001998.221908402825
  -rw-rw----    1 aibarkr2 aibark    685618156 Oct 23 22:50 batm53_20131023_BARC5300001201310230000000100177828.225444925615
               


 

If you want a mail when delivery is done then the most logical is to get the program that load the files in your directory to send the mail...
The lowest time schedule under cron is a minute, you want a program to run from 22:00 to 01:00 next day every minute? ( 180 times?)

may u please elaborate it, appreciate ur help as i need to make script for my new project.

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 with fixed format of filename [batm53_20131017_BARC5300001*20131017*0000000200004233.221341696408].I bold it date in filename . i have listed directory content which shows file name. please help me on making the script, whenever file comes in directory between 10pm to 1 am, it send mail to me.

ls -lrt | tail
  -rw-rw----    1 aibarkr2 aibark     37397479 Oct 17 22:14 bat053_20131017_BARC5300001201310170000000200004233.221341696408
  -rw-rw----    1 aibarkr2 aibark    620963845 Oct 17 22:56 bat053_20131017_BARC5300001201310170000000100193868.225022664298
  -rw-rw----    1 aibarkr2 aibark      6105620 Oct 19 00:33 bat053_20131019_BARC5300001201310180000000200008798.003410428376
  -rw-rw----    1 aibarkr2 aibark    714987170 Oct 19 01:14 bat053_20131019_BARC5300001201310180000000100179608.011058444311
  -rw-rw----    1 aibarkr2 aibark      1513941 Oct 21 22:20 bat053_20131021_BARC5300001201310210000000200001064.222345400253
  -rw-rw----    1 aibarkr2 aibark    761353431 Oct 21 23:07 bat053_20131021_BARC5300001201310210000000100179307.230054883420
  -rw-rw----    1 aibarkr2 aibark      3488099 Oct 22 22:27 bat053_20131022_BARC5300001201310220000000200002859.222646691462
  -rw-rw----    1 aibarkr2 aibark    662128252 Oct 22 23:05 bat053_20131022_BARC5300001201310220000000100174007.230205970923
  -rw-rw----    1 aibarkr2 aibark      2143648 Oct 23 22:20 bat053_20131023_BARC5300001201310230000000200001998.221908402825
  -rw-rw----    1 aibarkr2 aibark    685618156 Oct 23 22:50 bat053_20131023_BARC5300001201310230000000100177828.225444925615

So, what have you tried so far? You will also need to tell us what you are using:-

  • Operating System
  • Version
  • Shell

.... and any tools you have a preference for and anything else relevant.

How do you want the file to appear in the email? Is this plain text to use in the body of the email, or are these to be attachments?

There's not really a lot to go on here and you need to make an effort to get us interested in a problem rather than just hoping for a bit of free code without any thought yourself.

Robin

i want to automate one task in unix and make one script.

There is directory in which everyday 2 files comes and that files come anytime in between 10 pm to 1 am.

file name is batm53_20131025_BARC5300001201310240000000200004233.221341696408

If u see filename has 3 part

1) batm53 which is constant
2) date when file arrive in directory
3) this part is BARC5300001201310170000000200004233.221341696408 in which BAR5300001 is constant and then after date of file . suppose today is 24th oct and file come after 1 am then second part of file name shows 25th oct but in third part after BAR5300001 it shows 24th oct date ( 20131024)

i am facing issue in this scenario

if file comes in between 10 pm to 12 am then i can make script easy with help of find command but i am facing issue in making that part how i can check if file comes after 12 am bceasue that file should be previous date and after 12 am date should change.

Please top spamming different forums with the same questions. It will not get you an answer any faster, and it will confuse people who would be willing to help.

Thank you.