Hi there,
I have a bit terrific problem / question.
I have to write some scripts that should automate some functions in our sun-environment.
We have several cobol programs that are running against an oracle db on the sun. Those programs create textfiles on the system (e.g. a listing of something). Now those files should be send automatically from inside shell-scripts via email or ftp to people/ftp-sites.
Sending those files via email/ftp is not a problem.
My problem is to detect when a file is ready to send. Example: Suppose the script shell check the directory /files/dir1 and send every file there via email and this script will started every hour by cron. Now just while the script checks the directory a cobol program is still running and writing to a file that it has created in /files/dir1.
How could I check in the script, that this file is still written and shouldnt be send?
Any ideas?
Axel
I have a bit terrific problem / question.
I have to write some scripts that should automate some functions in our sun-environment.
We have several cobol programs that are running against an oracle db on the sun. Those programs create textfiles on the system (e.g. a listing of something). Now those files should be send automatically from inside shell-scripts via email or ftp to people/ftp-sites.
Sending those files via email/ftp is not a problem.
My problem is to detect when a file is ready to send. Example: Suppose the script shell check the directory /files/dir1 and send every file there via email and this script will started every hour by cron. Now just while the script checks the directory a cobol program is still running and writing to a file that it has created in /files/dir1.
How could I check in the script, that this file is still written and shouldnt be send?
Any ideas?
Axel