Re: program to copy files - problems - unix ksh to java

From: hiwa (HGA03630_at_nifty.ne.jp)
Date: 02/10/04


Date: 9 Feb 2004 18:05:27 -0800

kaeli <tiny_one@NOSPAM.comcast.net> wrote in message news:<MPG.1a9172689199094e989bf1@nntp.lucent.com>...
> Hi all,
>
> I've got a shell script (ksh) that does some file copying and deleting.
> I'm running into some problems with it that I'm wondering if I can
> solve. Since I plan on re-writing it with java (1.4), I figure I might
> as well do it right this time.
>
> Here's the drill:
> Cron runs this code every 5 minutes.
> Program looks on one machine, uses ssh to copy a file to another
> machine, changes the filename, the owner and permissions (chmod), and
> then deletes the file from the source machine.
> Sounds simple enough...
>
> Problems:
> Large files (we're talking gigabytes) take more than 5 minutes to copy.
> Something is causing the file to be deleted before it has finished
> copying. We lose the whole file, as it doesn't show up on either
> machine.
> Program gets called again while an instance is running, so it tries to
> copy files that are currently being copied.
>
> I was going to solve this with the usual .running type fix, but we
> really need the program to actually run every 5 minutes (more than one
> instance will be needed). If an instance is already copying the file,
> the file should just be ignored. The file should not be deleted if the
> copy hasn't finished.
>
> Does anyone know of any system stuff I should be looking at for java?
> Specifically, Unix Solaris interface so I can tell if a file is in use?
> Also, how can I make sure that the copy was finished before deleting the
> source? I expected the script to wait for the copy to finish before
> deleting, but it appears that it is not doing that. Should I use threads
> for this?
>
> Thanks for any ideas, input, etc...
>
> --
Are you syncing or flushing with proper synchronization?



Relevant Pages

  • program to copy files - problems - unix ksh to java
    ... I've got a shell script that does some file copying and deleting. ... then deletes the file from the source machine. ...
    (comp.lang.java.programmer)
  • Re: program to copy files - problems - unix ksh to java
    ... > copying. ... sounds like the first process, when finished, deletes the file, ... I expected the script to wait for the copy to finish before ... > deleting, but it appears that it is not doing that. ...
    (comp.lang.java.programmer)
  • Re: [kde] Konqueror is very slow!!!
    ... every file in a directory, before moving, copying or deleting it? ... Because it wants to show a progress information. ...
    (KDE)
  • Isass.exe - System Error
    ... I had to restore my registry by copying and deleting ... computer begain to reboot, ...
    (microsoft.public.windowsxp.security_admin)
  • User profiles and C/C++
    ... XP)(creating, copying, deleting and mapping to the other drive). ... Is there any valuable source of information how to do task like that? ...
    (microsoft.public.win32.programmer.kernel)