Hi All,
In the file names we have dates.
Based on the file format given by the user,
if any file is not existed for a particular date with in a given interval we should consider that file is missing.
I have the below files in the directory /bin/daily/voda_files.
asr_spir_2017-05-10-150325_2017-05-10-112227_2017-05-13-112227.txt
adb_voda_2017-05-11-150325_2017-05-10-112227_2017-05-13-112227.txt
adb_voda_2017-05-14-150325_2017-05-11-112227_2017-05-10-112227.txt
adb_voda_2017-05-12-150325_2017-05-12-112227_2017-05-11-112227
adb_voda_2017-05-16_2017-04-30_2017-05-01.txt
adb_voda_20170510.txt
adb_voda_2017-05-10.txt
2017-05-11
2017-05-10.txt
2017-05-12
If user entered
file_format=xxx_xxxx_YYYY-MM-DD-HHIISS_?????????????????_?????????????????.txt
prog_name="abd_voda_"
interval=10 (from current date -1 to 10 days back It should be from 2017-05-08 to 2017-05-17)
In this case it should consider the first date in the file.
The missing files output should be
adb_voda_2017-05-08
adb_voda_2017-05-09
adb_voda_2017-05-10
adb_voda_2017-05-12
adb_voda_2017-05-13
adb_voda_2017-05-15
adb_voda_2017-05-16
adb_voda_2017-05-17
If user entered
file_format=xxx_xxxx_?????????????????_?????????????????_YYYY-MM-DD-HHIISS.txt
prog_name="abd_voda_"
interval=10 (from current date -1 to 10 days back It should be from 2017-05-08 to 2017-05-17)
In this case it should consider the last date in the file.
The missing files output should be
adb_voda_2017-05-08
adb_voda_2017-05-09
adb_voda_2017-05-11
adb_voda_2017-05-12
adb_voda_2017-05-14
adb_voda_2017-05-15
adb_voda_2017-05-16
adb_voda_2017-05-17
If user entered
file_format=YYYY-MM-DD
prog_name=""
interval=10 (from current date -1 to 10 days back It should be from 2017-05-08 to 2017-05-17).
It should consider the files which are having only YYYY-MM-DD.
The missing files output should be
2017-05-08
2017-05-09
2017-05-10
2017-05-13
2017-05-14
2017-05-15
2017-05-16
2017-05-17
Please help me with the script.
Thanks in advance.