From b4446cba9ae6a68cfa646949c38d751677c84371 Mon Sep 17 00:00:00 2001 From: William Wernert Date: Wed, 4 Nov 2020 14:20:51 -0500 Subject: [PATCH] [refactor][wip] Also backup directories in /nsm --- setup/so-functions | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/setup/so-functions b/setup/so-functions index faadee63f..ad2ce7f41 100755 --- a/setup/so-functions +++ b/setup/so-functions @@ -1442,8 +1442,11 @@ reinstall_init() { mv /opt/so "/opt/so_old_${date_string}" fi - # Remove container data directories - rm -rf /nsm/mysql + # Backup /nsm for the same reason + while IFS= read -r -d '' dir; do + mv "$dir" "${dir}_old_${date_string}" + done < <(find /nsm -maxdepth 1 -mindepth 1 -type d -print0) + # Remove the old launcher package in case the config changes if [ $OS = 'centos' ]; then