Skip to content

Commit

Permalink
Add a new echo message when data integrity check succeeded
Browse files Browse the repository at this point in the history
  • Loading branch information
hehe7318 committed Jun 18, 2024
1 parent 8a5a407 commit bc4d7f8
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
code <<-EOH
diff_output=$(diff -r #{node['cluster']['cluster_user_home']} #{node['cluster']['cluster_user_local_home']})
if [[ $diff_output != *"Only in #{node['cluster']['cluster_user_home']}"* ]]; then
echo "Data integrity check succeeded, removing temporary directory /tmp#{node['cluster']['cluster_user_home']}"
rm -rf /tmp#{node['cluster']['cluster_user_home']}
else
only_in_cluster_user_home=$(echo "$diff_output" | grep "Only in #{node['cluster']['cluster_user_home']}")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
rsync -a --ignore-existing /tmp/home/ /home
diff_output=$(diff -r /tmp/home/ /home)
if [[ $diff_output != *"Only in /tmp/home"* ]]; then
echo "Data integrity check succeeded, removing temporary directory /tmp/home"
rm -rf /tmp/home/
else
only_in_tmp=$(echo "$diff_output" | grep "Only in /tmp/home")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@
rsync -a --ignore-existing /tmp#{dir}/ #{dir}
diff_output=$(diff -r /tmp#{dir}/ #{dir})
if [[ $diff_output != *"Only in /tmp#{dir}"* ]]; then
rm -rf /tmp#{dir}/
echo "Data integrity check succeeded, removing temporary directory /tmp#{dir}"
rm -rf /tmp#{dir}
else
only_in_tmp=$(echo "$diff_output" | grep "Only in /tmp#{dir}")
echo "Data integrity check failed comparing #{dir} and /tmp#{dir}. Differences:"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
code: <<-CODE
diff_output=$(diff -r #{original_user_home} #{destination_user_local_home})
if [[ $diff_output != *"Only in #{original_user_home}"* ]]; then
echo "Data integrity check succeeded, removing temporary directory /tmp#{original_user_home}"
rm -rf /tmp#{original_user_home}
else
only_in_cluster_user_home=$(echo "$diff_output" | grep "Only in #{original_user_home}")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@
rsync -a --ignore-existing /tmp#{dir}/ #{dir}
diff_output=$(diff -r /tmp#{dir}/ #{dir})
if [[ $diff_output != *"Only in /tmp#{dir}"* ]]; then
rm -rf /tmp#{dir}/
echo "Data integrity check succeeded, removing temporary directory /tmp#{dir}"
rm -rf /tmp#{dir}
else
only_in_tmp=$(echo "$diff_output" | grep "Only in /tmp#{dir}")
echo "Data integrity check failed comparing #{dir} and /tmp#{dir}. Differences:"
Expand Down

0 comments on commit bc4d7f8

Please sign in to comment.