From a14dad152c651ab8048f9e10898d4d2cc61b0d42 Mon Sep 17 00:00:00 2001 From: "J. Eric Ivancich" Date: Mon, 11 Mar 2024 17:19:40 -0400 Subject: [PATCH] rgw: rgw-restore-bucket-index -- sort uses specified temp dir The sort command sometimes makes use of temporary files. When the user specifies a directory to be used for temp files, have the sort command use that same directory. Signed-off-by: J. Eric Ivancich --- src/rgw/rgw-restore-bucket-index | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/rgw/rgw-restore-bucket-index b/src/rgw/rgw-restore-bucket-index index 3b00ac9767a17..a38d97068a231 100755 --- a/src/rgw/rgw-restore-bucket-index +++ b/src/rgw/rgw-restore-bucket-index @@ -1,6 +1,6 @@ #!/usr/bin/env bash -# version 2024-03-04 +# version 2024-03-11 # rgw-restore-bucket-index is an EXPERIMENTAL tool to use in case # bucket index entries for objects in the bucket are somehow lost. It @@ -65,7 +65,7 @@ EOF # cleans all temporary files clean() { if [ "$clean_temps" == 1 ] ;then - rm -f $bkt_entry $temp_file_list + rm -f $bkt_entry $temp_file_list \ $zone_info $olh_info_enc $olh_info_json fi } @@ -272,7 +272,7 @@ handle_versioned() { test_temp_space rados -p $pool stat2 $obj --object-locator "$loc" done | # output of stat2, which includes mtime - sort -k 3 | # stat2 but sorted by mtime earlier to later + sort -T $temp_dir -k 3 | # stat2 but sorted by mtime earlier to later grep -v -e "$filter_out_last_instance" | # remove the final instance in case it's not last # sed 1) removes pool and marker, 2) removes indicator of -- 2.39.5