Index: scripts/decommission.sh =================================================================== diff -u -rafc592ea044004b8b710c31bff8e7edde4e1d4c9 -r7089bfe86e26d42a9aaab8a3fd3d7d465c3ee0c9 --- scripts/decommission.sh (.../decommission.sh) (revision afc592ea044004b8b710c31bff8e7edde4e1d4c9) +++ scripts/decommission.sh (.../decommission.sh) (revision 7089bfe86e26d42a9aaab8a3fd3d7d465c3ee0c9) @@ -171,16 +171,27 @@ } function deleteLogFiles() { - # TODO this will always fail due to the fact that - # UI is not pausing on it's writing of log when we attempt a removal, causing the count to always be > 0 - clearFolderContent $LOC_LOG_BASE_FOLDER "logs" + # handling log deletion in a special manner: + # - Log files generated today + # - are not deleted + # - not part of the checking whether deletion was successful + # - setting maxDepth to 2 due to path used is root level with sd-card/ folders of logs + find "$LOC_LOG_BASE_FOLDER" -maxdepth 2 -type f -daystart -mtime +0 -exec rm -f {} + + + _has_error_=$? + exitError $_has_error_ $ERR_REMOVE_CMD_FIL "Log file deletion" + + fileCount=$(find "$LOC_LOG_BASE_FOLDER" -maxdepth 2 -type f -daystart -mtime +0 | wc -l) + _has_error_=$fileCount + exitError $_has_error_ $ERR_REMOVE_DEL_FIL "Remained '$fileCount' file undeleted" } function deletePartitionPassword() { # TODO it is not clear how # and by the way it is not user dependent password toget reset # it is managed by UI App and it will be working regardless of the user. # ./crupt_setup + echo "" # cannot be empty, syntax error } function deleteCloudSyncTokens() {