Permalink
Browse files

MB-7930: delete all but 10 last erl_crash.dump-s

Change-Id: Iab52965c8a04a41f4d661529d434191aaa2cde8a
Reviewed-on: http://review.couchbase.org/27682
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Reviewed-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
  • Loading branch information...
1 parent 6bf06d7 commit 99e43f99525c09ed399a08064847639582d7ff77 Aliaksey Kandratsenka committed with aartamonau Jul 25, 2013
Showing with 9 additions and 1 deletion.
  1. +9 −1 couchbase-server.sh.in
View
@@ -34,7 +34,7 @@ couch_start_arguments=""
LD_LIBRARY_PATH="@PREFIX@/lib":"@PREFIX@/lib/memcached":$LD_LIBRARY_PATH
export LD_LIBRARY_PATH
-ERL_CRASH_DUMP=erl_crash.dump.$(date +%m-%d-%Y-%H:%M:%S).$$
+ERL_CRASH_DUMP=erl_crash.dump.$(date +%s).$$
export ERL_CRASH_DUMP
ERL_FULLSWEEP_AFTER=512
@@ -103,12 +103,20 @@ _load_config () {
fi
}
+_drop_old_crashdumps () {
+ ls -1 erl_crash.dump.* | sort | head -n -10 | xargs -- rm -f
+}
+
+
_start() {
_check_nofile
_prepare_datadir
_maybe_start_epmd
_load_config
+ # note: we depend on pwd being $datadir from _prepare_datadir
+ _drop_old_crashdumps
+
# Set an ENV variable to force C++ STL and string classes to not use its
# default memory pooling allocator.
# For GCC 3.2.2 and later

0 comments on commit 99e43f9

Please sign in to comment.