From bcd5fac0d6cc6f3c0ee3a0b01233fc4cb8e8af95 Mon Sep 17 00:00:00 2001 From: Kjeld Schouten-Lebbing Date: Tue, 27 Dec 2022 13:29:07 +0100 Subject: [PATCH] Run more function async --- truetool.sh | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/truetool.sh b/truetool.sh index cf7809ea..2f7b3dfc 100755 --- a/truetool.sh +++ b/truetool.sh @@ -182,7 +182,21 @@ fi [[ "$dns" == "true" ]] && dns && exit [[ "$restore" == "true" ]] && restore && exit [[ "$mountPVC" == "true" ]] && mountPVC && exit -[[ "$number_of_backups" -ge 1 ]] && backup -[[ "$sync" == "true" ]] && sync +if [[ "$number_of_backups" -gt 1 && "$sync" == "true" ]]; then # Run backup and sync at the same time + echo "Running Apps Backup & Syncing Catalog" + if [[ "$prune" == "true" ]]; then + prune & + fi + backup & + sync & + wait +elif [[ "$number_of_backups" -gt 1 && -z "$sync" ]]; then # If only backup is true, run it + echo "Running Apps Backup" + backup +elif [[ "$sync" == "true" && -z "$number_of_backups" ]]; then # If only sync is true, run it + echo "Syncing Catalog" + echo -e "Syncing Catalog(s)\n\n" + sync +fi [[ "$update_all_apps" == "true" || "$update_apps" == "true" ]] && update_apps [[ "$prune" == "true" ]] && prune