Add cmd to remove old smlog files.
Bug: b/31092195
Change-Id: I8f54aa8af39930bf432c1c6aeed3b3fda6971db7
diff --git a/dumpstate/dumpstate.cpp b/dumpstate/dumpstate.cpp
index 93485c7..dba4779 100755
--- a/dumpstate/dumpstate.cpp
+++ b/dumpstate/dumpstate.cpp
@@ -50,6 +50,8 @@
/* Only SMLOG is enable, and SMLOG DUMP would be excuted */
if (ret_val == 1) {
run_command("SMLOG DUMP", 30, SU_PATH, "root", "smlog_dump", "-d", NULL);
+ // Remove smlog folders older than 10 days.
+ run_command("RM OLD SMLOG", 30, SU_PATH, "root", "/system/bin/sh", "-c", "find /data/smlog_* -mtime +10 -prune -delete", NULL);
}
}