diff --git a/CHANGELOG.md b/CHANGELOG.md index 203118e6..ed66b592 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,7 +13,7 @@ All notable changes to this project will be documented in this file. ### Fixed -- None +- Fix permanent data scripts ([#1603](https://github.com/wazuh/wazuh-docker/pull/1603)) ### Deleted diff --git a/build-docker-images/wazuh-manager/config/etc/cont-init.d/0-wazuh-init b/build-docker-images/wazuh-manager/config/etc/cont-init.d/0-wazuh-init index 9edb1b00..b75501f8 100644 --- a/build-docker-images/wazuh-manager/config/etc/cont-init.d/0-wazuh-init +++ b/build-docker-images/wazuh-manager/config/etc/cont-init.d/0-wazuh-init @@ -47,12 +47,8 @@ mount_permanent_data() { if find ${permanent_dir} -mindepth 1 | read; then print "The path ${permanent_dir} is already mounted" else - if find ${data_tmp} -mindepth 1 | read; then print "Installing ${permanent_dir}" - exec_cmd "cp -a ${data_tmp}. ${permanent_dir}" - else - print "The path ${permanent_dir} is empty, skipped" - fi + exec_cmd "cp -ar ${data_tmp}. ${permanent_dir}" fi done } diff --git a/build-docker-images/wazuh-manager/config/permanent_data.sh b/build-docker-images/wazuh-manager/config/permanent_data.sh index 4df54af5..89e5f8f3 100644 --- a/build-docker-images/wazuh-manager/config/permanent_data.sh +++ b/build-docker-images/wazuh-manager/config/permanent_data.sh @@ -30,11 +30,7 @@ mkdir ${PERMANENT_PATH} for permanent_dir in "${PERMANENT_DATA[@]}"; do # Create the directory for the permanent file if it does not exist DIR=$(dirname "${permanent_dir}") - if [ ! -e ${PERMANENT_PATH}${DIR} ] - then - mkdir -p ${PERMANENT_PATH}${DIR} - fi - - mv ${permanent_dir} ${PERMANENT_PATH}${permanent_dir} + mkdir -p ${PERMANENT_PATH}${DIR} + cp -ar ${permanent_dir} ${PERMANENT_PATH}${DIR} done