[bugfix][T108][bug-view-2072] Solve the problem that cp logs below 60M have not been tar and saved
Only Configure: No
Affected branch: GSW_V1453
Affected module: log
Self-test: yes
Doc Update: no
Change-Id: I4218ce15148bc9dbcb3243908d317f33b686fc37
diff --git a/package/base-files/files/etc/init.d/boot b/package/base-files/files/etc/init.d/boot
index 36724d1..dd87395 100755
--- a/package/base-files/files/etc/init.d/boot
+++ b/package/base-files/files/etc/init.d/boot
@@ -60,7 +60,20 @@
sync
if [ "$PRODMODE" == "0" ] && [ "$RDUPMODE" == "1" ];then
- nice -n -5 /bin/diag &
+ if [ -d "/media/var/log/Log000" ] && [ -n "$(ls -A /media/var/log/Log000 2>/dev/null)" ]; then
+ for file in /media/var/log/Log000/*.sdl; do
+ [ -e "$file" ] || continue
+ f=$(basename "$file")
+ n=1
+ dst="/media/var/log/${f%.*}.$n.sdl"
+ while [ -e "$dst" ]; do
+ n=$((n + 1))
+ dst="/media/var/log/${f%.*}.$n.sdl"
+ done
+ mv "$file" "$dst"
+ done
+ fi
+ nice -n -5 /bin/diag &
fi
# temporary hack until configd exists