From 36cbdf6ba8426302d9e9a42ee6ecf730812f752f Mon Sep 17 00:00:00 2001 From: Guillaume Raffy Date: Mon, 9 May 2022 18:39:06 +0200 Subject: [PATCH] fixed bug that caused the displayed disk not to be the path that the users see --- cluster/disk-watchdog.sh | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/cluster/disk-watchdog.sh b/cluster/disk-watchdog.sh index 558730c..5f0b322 100755 --- a/cluster/disk-watchdog.sh +++ b/cluster/disk-watchdog.sh @@ -149,17 +149,9 @@ function check_disk_usage() log "listing usage of $shared_disk_root into $disk_usage_report_file_path" du -sm ${shared_disk_root}/* | tee "${tmp_disk_usage_report_file_path}" - cat ${tmp_disk_usage_report_file_path} | awk '{ printf("%s ", $1); system("stat --printf=''%U'' " $2); printf(" %s\n", $2); }' > "${disk_usage_report_file_path}" + cat ${tmp_disk_usage_report_file_path} | sed "s|${shared_disk_root}|${disk_public_path}|g" | awk '{ printf("%s ", $1); system("stat --printf=''%U'' " $2); printf(" %s\n", $2); }' > "${disk_usage_report_file_path}" rm "${tmp_disk_usage_report_file_path}" - # for path in $(cat ${disk_usage_report_file_path} | awk '{printf("%s ", $2)}') - # do - # echo $path - # local owner=$(ls -l $path | awk '{print $2}') - # echo $owner - # done - # sed "s|${shared_disk_root}|${disk_public_path}|g" | - local disk_fullness=$(sheet_get_column $disk_global_usage_report_file_path 'Use%' | sed 's/%//') local disk_size_in_mb=$(sheet_get_column $disk_global_usage_report_file_path '1M-blocks' | sed 's/%//') log "disk fullness = $disk_fullness %"