Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix permanent data scripts #1603

Merged
merged 2 commits into from
Nov 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
8 changes: 2 additions & 6 deletions build-docker-images/wazuh-manager/config/permanent_data.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Loading