[colug-432] Scripting

Rob Stampfli rob944 at cboh.org
Sun May 19 10:36:35 EDT 2019


On Sun, May 19, 2019 at 09:56:27AM -0400, Vince Herried wrote:
> I wrote a script to download a couple of files .bz2 files from the internet.
> then I need to send a copy to another machine in my LAN and uncompress them.
> 
> So I thought to add the copy to the other machine with scp.
> I want to make the scp asynchronous.  But how do I alert myself when the
> async scp is done?
> 
> in pigeon something like this is going on.
> 
> 0. if new version of file A
> 1. then  download from internet
> 2. Wait for download to complete
> 3. start async scp to other host in my LAN
>    scp file?.bz2 otherhost:/dir &
> 
> 4. check new version of file B, if found repeat steps 1 - 3 above with file
> B
> 
> 5. wait for all async to complete.
> 6. unzip the files and remove the compressed versions.
> 
> So How do I perform step 5?

I think what you are looking for is the *sh "wait" command, but beware:
if you wind up with *lots* of async scps running simultaneously, that in
itself might pose a problem.


More information about the colug-432 mailing list