From 5f11c45ed71b03369d5030920f03cd3552a41598 Mon Sep 17 00:00:00 2001 From: steveokard Date: Sat, 26 Nov 2022 17:45:55 -0500 Subject: [PATCH] parallel-ized --- scripts/server_bin/update_itaku.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/scripts/server_bin/update_itaku.sh b/scripts/server_bin/update_itaku.sh index 7aff7ac..78b8406 100755 --- a/scripts/server_bin/update_itaku.sh +++ b/scripts/server_bin/update_itaku.sh @@ -1,8 +1,11 @@ #!/bin/bash +N=2 cd $HOME/gallery-dl/itaku for i in *; do echo ">> $i" - gallery-dl --abort 3 --sleep 2 https://itaku.ee/profile/$i/gallery - sleep 15 + (gallery-dl --abort 3 --sleep 2 https://itaku.ee/profile/$i/gallery) & + if [[ $(jobs -r -p | wc -l) -ge $N ]]; then + wait -n + fi done