Simple shell script which runs lists of shell commands in parallel
Project description
Shell multiprocess
A script which runs shell commands in parallel. Commands are being fed from a file.
Install:
$: python3 -m pip install shell-multiprocess
Run:
$: multiprocess -h
usage: multiprocess [-h] [-s] [-l] filename processes
Script which reads a file with shell commands and runs them in parallel
processes.
positional arguments:
filename Filename with commands
processes Amount of parallel processes
optional arguments:
-h, --help show this help message and exit
-s, --soft-kill Sends SIGINT signal to subprocesses instead of SIGKILL
during cleanup after CTRL-C
-l, --log-to-file Send multiprocess sumup to file with name
'multiprocess_{pid}.log'. Log is being update each time
an event occurs and can be viewed to monitor progress.
Create a command file:
$: cat > cmd.list
sleep 1 && sleep2 && echo finished_1_2
sleep 3 && echo finished_3 # finish with CTRL+D
Run it in parallel - both lines should finish at the same time:
multiprocess cmd.list 2
finished_3
finished_1_2
status | start | end | elapsed | command
----------- | ------------------- | ------------------- | ------------------- | -------
done | 2021-08-17 22:28:12 | 2021-08-17 22:28:15 | 0:00:03.003935 | sleep 1 && sleep 2 && echo finished_1_2
done | 2021-08-17 22:28:12 | 2021-08-17 22:28:15 | 0:00:03.000876 | sleep 3 && echo finished_3
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
shell_multiprocess-1.0.2.tar.gz
(18.0 kB
view hashes)
Built Distribution
Close
Hashes for shell_multiprocess-1.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8451a72489409b3c63684b108a4be817f7dd043318e36e040a54fe6ebeb272ae |
|
MD5 | be32a9a60e218aa7ea20ea10928aaaff |
|
BLAKE2b-256 | 3e559bdac0da33adab216800dede2f445c168327bf92f12055c8842eea05b15c |