Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F2912179
rm-oversize-from-origin
Public
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Authored By
zack
Nov 3 2017, 2:35 PM
2017-11-03 14:35:02 (UTC+1)
Size
659 B
Subscribers
None
rm-oversize-from-origin
View Options
#!/bin/bash
oversize_list
=
"/srv/storage/space/lists/oversize-contents.txt.xz"
objstorage_root
=
"/srv/softwareheritage/objects"
oversize_root
=
"/srv/softwareheritage/oversize-objects"
dry_run
=
"y"
act
()
{
if
[
"
$dry_run
"
=
"y"
]
;
then
echo
"* dry run:
$@
"
else
"
$@
"
fi
}
warn
()
{
echo
"* WARNING:
$1
"
}
xzcat
"
$oversize_list
"
|
while
read
obj_id
;
do
old_path
=
"
${
objstorage_root
}
/
${
obj_id
:
0
:
2
}
/
${
obj_id
:
2
:
2
}
/
${
obj_id
:
4
:
2
}
/
${
obj_id
}
"
new_path
=
"
${
oversize_root
}
/
${
obj_id
:
0
:
2
}
/
${
obj_id
:
2
:
2
}
/
${
obj_id
}
"
if
!
[
-f
"
$new_path
"
]
;
then
warn
"
$obj_id
is missing from oversize storage, not removing"
continue
else
act
rm
"
$old_path
"
fi
done
File Metadata
Details
Attached
Mime Type
text/x-shellscript
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
204802
Attached To
T809: move contents larger than current injection limit to separate object storage
Event Timeline
zack
changed the visibility from "
zack (Stefano Zacchiroli)
" to "Public (No Login Required)".
Nov 3 2017, 2:37 PM
2017-11-03 14:37:33 (UTC+1)
Log In to Comment