Skip to content

Commit 0ac9ca7

Browse files
committed
fix cleanup script bug: don't shred files if we're deleting the entire directory
building an AMI off the latest main branch currently fails at the ssm log cleanup. shred complains no such file or directory. instead of debugging the shred failure, we'll simply remove shredding since we do a rm -rf on the directory anyways.
1 parent 598499e commit 0ac9ca7

File tree

1 file changed

+0
-8
lines changed

1 file changed

+0
-8
lines changed

scripts/cleanup.sh

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -104,14 +104,6 @@ if [[ $(sudo find {{workingDirectory}}/TOE_* -type d | sudo wc -l) -gt 0 ]]; the
104104
fi
105105

106106
echo "Cleaning up ssm log files"
107-
if [[ $(sudo find /var/log/amazon/ssm -type f | sudo wc -l) -gt 0 ]]; then
108-
echo "Deleting files within /var/log/amazon/ssm/*"
109-
sudo find /var/log/amazon/ssm -type f -exec shred -zuf {} \;
110-
fi
111-
if [[ $(sudo find /var/log/amazon/ssm -type f | sudo wc -l) -gt 0 ]]; then
112-
echo "Failed to delete /var/log/amazon/ssm"
113-
exit 1
114-
fi
115107
if sudo test -d "/var/log/amazon/ssm"; then
116108
echo "Deleting /var/log/amazon/ssm/*"
117109
sudo rm -rf /var/log/amazon/ssm

0 commit comments

Comments
 (0)