I want to move files from directory A to directory B. But there are some conditions.
directory A structure:
a.txt_20170502 b.txt_20170502 a.txt_20170507 asd.txt_20170509 asd.txt_20170522
So, I want to rename
a.txt and move that file to directory B, but if
a.txt is present in directory B, it will not move that file.
This process continue until all the candidate files are moved from directory A to B.
I am confused how I can check if files are already in that directory,It will not move that file.
Condition :- There is another script running in background which will fetching data from directory B. So, if any files are present in directory B , it will be automatically copied mainframe server.