Hi Folks,
I have a scenario where in I need to pick up a file from a /src directory and send it to 2 different target directories based on the timestamp. The first target directory /dir1 should be receiving all the files but the second target directory /dir2 should be receiving the files which are placed on only sundays. so for example if the files are placed daily with their timestamps as FileName12012014.txt (Mondays File) , FileName12022014.txt (Tuesdays file)---------.......FileName12072014.txt (sundays file) then based on the datetstamp the file which are placed only on sundays should go to second target directory /dir2 and all the files including the ones placed on sunday should go to first target directory /dir1.
If I have to achieve this using shell script and use that in PI file channel can I do the following :
The Shell script checks /src directory for files with todays date and if the todays date is not Sunday then the file is put in /dir1 only. and if the date is today's date and sunday then file is put in /dir1 directory as well as /dir2 Directory. Now use the shell script .sh in 1st sender comm channel (in Run OS before message processing) and configure the /dir1 directory in the channel. Take another sender comm channel and configure /dir2 directory to pick up the sunday files.
Please let me know if this approach is correct, also suggest if there is any better approach.
Regards
Kalyan