Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Parallel backupping embedded systems...how?
- X-seq: zsh-users 19514
- From: Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: Re: Parallel backupping embedded systems...how?
- Date: Tue, 9 Dec 2014 20:31:14 +0000
- In-reply-to: <20141209182415.GB4483@solfire>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <20141209182415.GB4483@solfire>
On Tue, 9 Dec 2014 19:24:15 +0100
meino.cramer@xxxxxx wrote:
> If I put both tar processes into background I dont know
> how to wait correctly for the jobs end to start 7z.
If you have the fix in 33531 this is easy. However, that's after 5.0.7.
process1 &
pid1=$!
process2 &
pid2=$!
wait $pid1
wait $pid2
It doesn't matter if they finish in the wrong order since the shell
remembers the status.
It's less easy before that, but you could use a SIGCHLD trap and the
$jobstates variable from zsh/parameter:
zmodload zsh/parameter
process1 &
process2 &
TRAPCHLD() {
if (( ${#jobstates} == 0 && jobs_started )); then
print Last background job edited, doing something else...
trap -- CHLD
fi
}
pws
Messages sorted by:
Reverse Date,
Date,
Thread,
Author