Hi All,
i am trying to automate a process and have to create a unix script like wise. I have a scenario in which i need to automate a file movement. Below are the steps i need to automate.
1. Check whether a file (Not Fixed name-Pattern search of file say 'E*.dat') is present in a directory /hm/srcfiles. In this directory, there will be files placed by a JSP on adhoc basis like E1.dat,E2.dat,E3.dat ......
2. A script/Job keeps sniffing this directory for files of this kind.... the moment it finds one, it should transfer the file to other directory say /hm/tgt but with renaming it to 'FILE.dat'. This transfer is conditional, the file movement should happen only if the /hm/tgt directory does not contain 'FILE.dat', and if 'FILE.dat' is present, it should wait and try to move the file again untill succeded.
3.The cleanup of file 'FILE.dat' from /hm/tgt/FILE.dat happens by another shell script called by a different application. I am kind of able to write that (I have not worked with unix scripting much
)
4.I guess CRON job scheduling should be used for triggering the file movement script, correct me if i am wrong.
5.This CRON job should run contineously and trigger the script when ever the
file named like 'E*.dat' arrives. Also if many files are present in /hm/src directory, all the files should be processed sequentially
Thanks for the patience to read the explaination. I do not know scripting much OR have used CRON job scheduling before. Can someone help me in this regard. I a sound too naive with UNIX, it is because i am