shell script to process the same files daily and weekly
Posted on 2014-12-03
I have a scenario where in the there are 2 receivers to which the file from source directory needs to be sent and the receiver is determined based on the timestamp on the file or more precisely depending on the day, and the same filename scehma is used in source to send to both the receivers.
FYI, The middleware I am using provides a file adapter which has options to include direcotry paths, include shell scripts to run before and after the file processing. I can use this File adapters and both sender and receiver sides. All I need is to finalize a logic for this approach and implement it in iSeries shell script.
For example if the source file in /src directory is FileName12022014 this needs to be sent to Receiver1 /rec1 directory only ----and in the same way all the files which are placed untill the 6th day in this case FileName12072014 should also be placed only in receiver1 directory /rec1. But the FileName12082014 which is the 7th day file should be sent to both the Receiver 1 and Receiver 2. I see we wont be able to achieve this without the shell script in the file adapter, but would appreciate suggestions on the best way to achieve this.