program to copy files - problems - unix ksh to java
From: kaeli (tiny_one_at_NOSPAM.comcast.net)
Date: 02/09/04
- Next message: Dale King: "Re: Why can't finally{} acces in-try{} variables?"
- Previous message: David Armour: "HTTPS and automating client sessions"
- Next in thread: hiwa: "Re: program to copy files - problems - unix ksh to java"
- Reply: hiwa: "Re: program to copy files - problems - unix ksh to java"
- Reply: Harald Kirsch: "Re: program to copy files - problems - unix ksh to java"
- Reply: Thomas Weidenfeller: "Re: program to copy files - problems - unix ksh to java"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Mon, 9 Feb 2004 10:33:48 -0600
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...
-- -- ~kaeli~ Bakers trade bread recipes on a knead-to-know basis. http://www.ipwebdesign.net/wildAtHeart http://www.ipwebdesign.net/kaelisSpace
- Next message: Dale King: "Re: Why can't finally{} acces in-try{} variables?"
- Previous message: David Armour: "HTTPS and automating client sessions"
- Next in thread: hiwa: "Re: program to copy files - problems - unix ksh to java"
- Reply: hiwa: "Re: program to copy files - problems - unix ksh to java"
- Reply: Harald Kirsch: "Re: program to copy files - problems - unix ksh to java"
- Reply: Thomas Weidenfeller: "Re: program to copy files - problems - unix ksh to java"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|