I am a newbie to shell scripting and I am facing a problem right now.I have to automate the copy of files based on a priority.The scenario is as below:
1) There will be files from Mon-Fri with Mon file being named as abc_def_01_YYYYMMDD and Tue file being abc_def_02_YYYYMMDD and so forth till Friday's file which would be abc_def_YYYYMMDD.
2) I have to set a priority such that if on any given day if i have more than one file, I have to copy the earlier file first.For instance if on Thursday i have monday's file and wednesday's file I have to copy the Monday's file first, then after a pre-defined delay send Wednesday's file-delay- and then send the thursday's file.
Please let me know how could i do it..Thanks in anticipation.
From this I assume that the source files are being removed periodically by something? i.e. you won't have old files hanging around that you've already processed?
Yes Carlo.Thanks for the quick response.The old files are being periodically removed.Once the file is copied is to the target location, they should be deleted.
Further, the file is the trigger to the script.
For some reason if the four files do not come on mon-thu and on fri if all 5 files come at once they should be sent based on the priority described above.
can this be done please?