From 7ec0034b65b3808b72fd80ee912d0ca48a53b447 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Sun, 21 Nov 2010 16:24:51 -0800 Subject: [PATCH] init-ceph: fix (and test!) cleanlogs and cleanalllogs Signed-off-by: Sage Weil --- src/init-ceph.in | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/init-ceph.in b/src/init-ceph.in index 400972ae23f..6525cfed1c9 100644 --- a/src/init-ceph.in +++ b/src/init-ceph.in @@ -314,15 +314,15 @@ for name in $what; do cleanlogs) echo removing logs if [ -n "$log_sym_dir" ]; then - do_cmd "for f in $log_sym_dir/$name*; do rm -f \`readlink \$f\` ; rm -f \$f ; done ; rm -f $log_dir/$name.*" - else - do_cmd "rm -f $log_dir/$name.*" + do_cmd "for f in $log_sym_dir/$type.$id.*; do rm -f \`readlink \$f\` ; rm -f \$f ; done ; rm -f $log_dir/$type.$id.*" fi + [ -n "$log_dir" ] && do_cmd "rm -f $log_dir/$type.$id.*" ;; cleanalllogs) echo removing all logs - do_cmd "rm -f $log_dir/* $log_sym_dir/* || true" + [ -n "$log_sym_dir" ] && do_cmd "rm -f $log_sym_dir/*" + [ -n "$log_dir" ] && do_cmd "rm -f $log_dir/*" ;; *)