diff --git a/bin/hbase-daemon.sh b/bin/hbase-daemon.sh index 6c895e9040..0001922438 100755 --- a/bin/hbase-daemon.sh +++ b/bin/hbase-daemon.sh @@ -68,6 +68,13 @@ hbase_rotate_log () if [ -n "$2" ]; then num=$2 fi + + if [ ! -f "$log" ]; then #for some jdk, gc log has a postfix 0 + if [ -f "$log.0" ]; then + mv -f "$log.0" "$log"; + fi + fi + if [ -f "$log" ]; then # rotate logs while [ $num -gt 1 ]; do prev=`expr $num - 1`