4
2
The scenario is this: Machine A has files I want to copy to Machine C. Machine A can't access C directly, but can access Machine B that can access Machine C. I am using scp to copy from Machine A to B, and then from B to C.
Machine B has limited storage space, so as files come in, I need to copy them to C and delete them from B. The second copy is much faster, so this is no problem with bandwidth.
I could do this by hand, but I am lazy. What I would like is to run a script on B or C that will copy each file to C as each one finishes. The scp job is running from A.
So what I need is a way to ask (preferably from a bash script) if file X.avi is "done" copying. Each of these files is a different size, and I can't really predict size or time of completion.
Edit: by the way, the file transfer times are something about 1 hour from A to B and about 10 minutes from B to C, if time scale matters at all.
The problem with this is that on machine A I want to do
scp * user@host:~/
and the files being copied would more than fill machine B, so I can't move/rename files after they are copied from A. – Mike Cooper – 2009-09-22T18:25:54.803Ah, so if I understand correctly, you're coping more than one file at once? That's where the problem comes from? – Josh – 2009-09-22T19:01:26.197
Yes, that is the problem. I can't store all the files on B, but this copy will take long enough that I don't want to sit and babysit it by watching for each file to finish and then copying it. Maybe I will go with your expanded version. – Mike Cooper – 2009-09-22T19:08:22.470