Script to check for and replace files?
Hi I'm pretty new to scripting but I'm trying to write a script that will look for new files, and if it finds files that haven;t been updated I want the script to replace all non-updated files to a specific file. To clarify, I have a scheduler set up to run 20 reports on a monthly basis, the output from these reports are then sent to a directory on our webserver so that they can be viewed online. I am currently overwriting the files on the weberver each month with updated reports of the same name to display updated content. I want to completely automate the process, but the problem is that some months there may only be 15 new reports so I have to manually change the path to indicate that there are no new reports for the other 5 for that month. I'm hoping that it's possible to write some kind of Perl or Bash script that will look for updated files in a directory on a given date, and if one or more of the report files has not been updated (overwritten) it will change the file path to display a no new report for this month message. Of course I can see potential problem with this because when the next monthly report is ran and the files are automatically transferred to the webserver directory they will not overwrite the the files that are pointing to the 'no new report message' from the previous month. I hope this makes some sense to someone, I'm having trouble figuring out where to start, but the more I think about it the more complicated it gets.
Last edited by mac-mark; 03-21-2009 at 05:52 PM.
|