AIX

AIX

Connect with fellow AIX users and experts to gain knowledge, share insights, and solve problems.


#Power
#Power
 View Only
  • 1.  Query in file processing

    Posted Thu January 28, 2010 02:31 AM

    Originally posted by: USRDV96


    Hi,
    We are currently reading file(eg test.dat) from DB server using ftp option to my local sever. This file will be loaded from external job.
    We are getting file from DB sever to local server and then we are removing the file from DB sever.

    At the time i'm getting the following error
    FTP>>> DELE test.dat

    FTP<<< 450 test.dat: Cannot open or remove a file containing a run
    ning program.

    This is because external job is still loading content in this file and this didnt complete the process. I want to get red of this error. For that we are planning to transfer file only after external job succusess fully loads data.

    My question is how to find the file is not used by other program and ready to tranfer and delte? So that i wont get any error message during delete operation of that file.

    Thanks in advance for your help.

    Kannan
    #AIX-Forum


  • 2.  Re: Query in file processing

    Posted Fri January 29, 2010 08:36 AM

    Originally posted by: MarkTaylor


    Probably the best way to do this is once the data load has finished, to move the file to test.dat.finished or something like that as part of the batch, then collect that filename .. other options would be lsof or fuser commands from a shell (not ftp)

    HTH
    Mark Taylor
    #AIX-Forum


  • 3.  Re: Query in file processing

    Posted Fri January 29, 2010 12:58 PM

    Originally posted by: SystemAdmin


    We have solved this problem.

    On the database server, create a file as .test.dat

    Once the data is loaded , rename it to test.dat

    Since the original file is .test.dat the ls will not display the file.

    Once the file is renamed to test.dat an ls will show it exists and no one should be writing to it anymore
    #AIX-Forum