From: J. Eric Ivancich Date: Mon, 11 Mar 2024 21:19:40 +0000 (-0400) Subject: rgw: rgw-restore-bucket-index -- sort uses specified temp dir X-Git-Tag: testing/wip-root-testing-20240411.174241~123^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=b85afb7de4415ecb7be7a2dbe0577d7310a5c1f1;p=ceph-ci.git 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 (cherry picked from commit a14dad152c651ab8048f9e10898d4d2cc61b0d42) --- diff --git a/src/rgw/rgw-restore-bucket-index b/src/rgw/rgw-restore-bucket-index index 3b00ac9767a..a38d97068a2 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