Re: program to copy files - problems - unix ksh to java
From: hiwa (HGA03630_at_nifty.ne.jp)
Date: 02/10/04
- Next message: Justin Fowler: "Re: Java and XML "templates""
- Previous message: Berlin Brown: "Re: Include a Servlet into web page body"
- In reply to: kaeli: "program to copy files - problems - unix ksh to java"
- Next in thread: kaeli: "Re: program to copy files - problems - unix ksh to java"
- Reply: kaeli: "Re: program to copy files - problems - unix ksh to java"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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?
- Next message: Justin Fowler: "Re: Java and XML "templates""
- Previous message: Berlin Brown: "Re: Include a Servlet into web page body"
- In reply to: kaeli: "program to copy files - problems - unix ksh to java"
- Next in thread: kaeli: "Re: program to copy files - problems - unix ksh to java"
- Reply: kaeli: "Re: program to copy files - problems - unix ksh to java"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|