Ideas for creating processes

J dreadpiratejeff at gmail.com
Wed Mar 10 23:04:47 CET 2010


On Wed, Mar 10, 2010 at 16:52, J <dreadpiratejeff at gmail.com> wrote:
> the quick and dirty would be (as I'm imagining it at the moment):
> for path in pathlist:
>    chdir into path
>    execute rsync or zsync
>
> but that gets me moving into one dir, updating, then moving into another.
>
> What I was wondering about though, is spawning off separate rsync
> processes to run concurrently (each rsync will hit a different remote
> dir for each local dir)
>
> so I'm trying to figure out a good way to do this:
>
> for path in pathlist:
>    kick off an individual rsync|zsync process to update path

And now I'm looking at subprocess and I can set shell=True and it will
intrepret special characters like &

So could I do something like this:

for item in pathlist:
    subprocess.Popen('rsync command &', shell=True)

and simply wait unti they are all done?



More information about the Python-list mailing list