Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F2912178
import-oversize
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:34 PM
2017-11-03 14:34:12 (UTC+1)
Size
833 B
Subscribers
None
import-oversize
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
}
"
new_dir
=
$(
dirname
$new_path
)
if
!
[
-f
"
$old_path
"
]
;
then
warn
"cannot found oversize object
$obj_id
, skipping"
continue
fi
if
!
[
-d
"
$new_dir
"
]
;
then
act
mkdir
-p
"
$new_dir
"
fi
if
!
[
-f
"
$new_path
"
]
;
then
act
cp
-a
"
$old_path
"
"
${
new_path
}
.new"
act
mv
"
${
new_path
}
.new"
"
$new_path
"
fi
done
File Metadata
Details
Attached
Mime Type
text/x-shellscript
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
204801
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:12 (UTC+1)
Log In to Comment